Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7604679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:58:29+00:00 2026-05-30T23:58:29+00:00

I am unsure how exactly emacs lisp treats function objects, is there a hidden

  • 0

I am unsure how exactly emacs lisp treats function objects, is there a hidden argument that I am not seeing, when I have this then when I hit C-c p it gives the error
Wrong type argument: commandp, load-cenet-files

I don’t know lisp at all.

(defun load-cenet-files ()
  (load-file "~/.emacs.d/cedet/common/cedet.elc")
  (require 'semantic-gcc)
)

(global-set-key (kbd "C-c p") '(load-cenet-files)) 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:58:31+00:00Added an answer on May 30, 2026 at 11:58 pm

    Emacs distinguishes between functions and commands – the latter are a special type of functions, namely those that can be invoked interactively by the user. The error message Wrong type argument: commandp, load-cenet-files tells you that some point in the code is expecting a command, but got something else. commandp is a predicate function that checks if its argument is a command; here, it tested load-cenet-files and found that is is not a command, thus barfed.

    You can turn a function into a command by declaring it interactive. You do this by adding the (interactive) declaration as the first line after the (defun function-name (args). Note that (interactive) is a special construction, it is not really a function call, but rather a declaration.

    (defun load-cenet-files ()
      (interactive)
      (load-file "~/.emacs.d/cedet/common/cedet.elc")
      (require 'semantic-gcc)
    )
    

    Once you turned a function into a command, you can then call it via M-x function-name. Also, if you want to bind a function to a keyboard shortcut, it must be a command. The latter is exactly why you’re seeing that error message: you’ve bound the load-cenet-files function to C-c p but it is a function, not a command. Once you insert (interactive) you should be fine.

    Lastly, it seems somewhat unusual that you’re trying to bind this functionality to a keyboard shortcut. Could you not just put the load-file and require into your “.emacs” file? Or, if you don’t want the files to be loaded globally, attach it to a mode-specific hook?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am unsure why this code will not work. When I click a button
This doesn't exactly seem to be right although I am unsure why. Advice would
Unsure exactly how to put this question so apologies for the awkward phrasing, generally
Unsure if I've phrased this correctly, but in the callback how do I reference
I am unsure if this is even possible, but I thought I would ask.
I have a requirement to create an installer for an Outlook 2003 add-in that
I have a CRM application (GoldMine) that acts as a DDE Server and allows
Can anyone explain what the jquery documentation is exactly referring to with this statement:
I'm looking at some 3rd party code and am unsure exactly what one line
I have an existing asp.net webforms application that I would like to add some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.