The documentation for M-x says:

M-x runs the command execute-extended-command (found in global-map),
which is an interactive compiled Lisp function in ‘simple.el’.

It is bound to <execute>, <menu>, M-x.

(execute-extended-command PREFIXARG &optional COMMAND-NAME TYPED)

  This function is for interactive use only;
  in Lisp code use ‘command-execute’ instead.

Read a command name, then read the arguments and call the command.
To pass a prefix argument to the command you are
invoking, give a prefix argument to ‘execute-extended-command’.

I'm still a beginner at Elisp so I'm not sure I understand all of this, but it is saying that this should run an interactive compiled Lisp function somewhere.

I recently was looking for a way to find the current frame height & width. I stumbled across this website after searching about it in my favourite search engine: https://www.gnu.org/software/emacs/manual/html_node/elisp/Frame-Size.html

Now, this is saying that, for example

Function: frame-height &optional frame

Function: frame-width &optional frame

These functions return the height and width of the text area of frame, measured in units of the default font height and width of frame (see Frame Font). These functions are plain shorthands for writing (frame-parameter frame 'height) and (frame-parameter frame 'width).

If the text area of frame measured in pixels is not a multiple of its default font size, the values returned by these functions are rounded down to the number of characters of the default font that fully fit into the text area.

that frame-height and frame-width are functions in Emacs. This seems like the legitimate gnu.org website so it should have the latest information. Not sure why this isn't working when I do M-x frame-height in Emacs; frame-height has [No Match] apparently.

Could anyone help me out in understanding this documentation?


A command is an interactively callable function (or keyboard macro). Therefore not every function is a command, but every command is a function (or keyboard macro).

The reason for this difference is that for executing a command, Emacs needs to obtain extra information from the user what arguments to pass to it. The most common way of specifying that is the interactive form, it allows declaring how each argument is obtained (for example by prompting the user for it, using the prefix argument or a hardcoded value).

To experiment with functions that don't happen to be commands, evaluate Emacs Lisp code directly, for example by typing it into the scratch buffer and using one of the many evaluation commands (like C-M-x to evaluate the form at point, C-x C-e to evaluate the s-expression behind point or M-x eval-buffer for the whole buffer).

  • C-M-x is not defined for me, even when running emacs -Q.
    – darcamo
    Nov 7 '20 at 18:03
  • It is defined inside Lisp mode buffers, like emacs-lisp-mode in *scratch*.
    – wasamasa
    Nov 8 '20 at 1:16

M-x is a key binding, which runs the command execute-extended-command.

A command is an interactive function. To turn a function to command, put (interactive SPEC) at the beginning of the function. A command can be invoked by user interactivity via its name with M-x or its key binding, for example, C-n and M-x next-line do the same thing.

Some interactive functions have lots of features that only make sense when user calls directly, thus not suitable for called by other Lisp code.

Most functions are not commands, you turn a function into a command, only when you're sure the user need to run it.

Not the answer you're looking for? Browse other questions tagged or ask your own question.