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

  • Home
  • SEARCH
  • 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 8600195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:33:47+00:00 2026-06-12T01:33:47+00:00

From what I understand, in Emacs I can run commands such as M-x (which

  • 0

From what I understand, in Emacs I can run commands such as M-x (which by the way I believe stands for execute-extended-command). This command M-x itself is used to run things like customize_face e.g. by typing M-x customize-face in the minibuffer.

My questions are:

Q.1. Is customize-face a command? or is it a function? And do we say that customize-face is passed to the command M-x as an argument?

Q.2 Do all Emacs commands have an associated Emacs function? (i.e. when I enter M-x customize-face I presume a defined function is called). If so, how can I look up the function name from the command name? (and viceversa)

  • 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-06-12T01:33:48+00:00Added an answer on June 12, 2026 at 1:33 am

    Yes, all Emacs commands are functions, but not all functions are Emacs commands. You can make an arbitrary elisp function a command accessible via M-x using (interactive):

    (defun my-command ()
     "This is the docstring"
     (interactive)
     (do-foo)
     (do-bar))
    

    Now that you’ve defined my-command as interactive, you can immediately access it with M-x my-command. Emacs does all the bookkeeping with the name for you automatically.

    This is all you have to do to add a new command! You can then bind it to a key with something like:

    (global-set-key (kbd "C-c f") 'my-command)
    

    Moreover, every key-binding is associated with an interactive function like this. You can find which function is called by which key using C-h k and entering your key sequence. This will give you the documentation for the function that would be called on that key sequence. If you ran the code I gave you, doing C-h k C-c f would give you a buffer containing (among other things) your doc-string:

    C-c f runs the command my-command, which is an interactive Lisp
    function.
    
    It is bound to C-c f.
    
    (my-command)
    
    This is the docstring
    

    So: all Emacs commands are just functions defined with (interactive). (Actually, there are also some primitive functions from Emacs’s C core, but that isn’t super important.)

    This simple and elegant relationship between commands and functions–which is easy to follow in either direction–is part of what makes Emacs so easy to customize. If you ever wonder what functions your normal actions called, you can easily look them up, and if you want to add more commands, you just have one extra line in your function.

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

Sidebar

Related Questions

I can very well understand from this Selectutorial what element/tag based descendant selectors are,
I'm trying to run the rgrep command from a small Emacs Lisp utility, but
ls -L | grep -v ^zip What i understand from this command is, it
I am trying to understand from this example if lubridate can be applied to
As you can understand from title, i modified Settings.cs file.Added some properties, some code
From what I understand using $this->db->insert() escapes the values: http://codeigniter.com/user_guide/database/active_record.html#insert Note: All values are
From what I understand there is no way of type-checking the messages send in
From what I understand, the best way to deal with dates in the Zend
I am trying to understand this example from Thinking in Java : package c07;
I understand from this post , that it's an anti-pattern to modify Object 's

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.