Go to the first, previous, next, last section, table of contents.


Calling Commands

When a command is to be invoked, the call-command function is used. This builds a list of argument values to apply to the command (using its interactive declaration) then calls the command.

Function: commandp object
This function returns t if its argument may be called interactively. If object is a function (i.e. a symbol or a lambda-expression) it is a command if it contains an interactive declaration (see section Interactive Declarations).

The only other object which is a command is a function call form; the use of these types of commands is discouraged but they can be useful sometimes.

(commandp 'setq)
    => nil

(commandp 'isearch-forward)
    => t

(commandp '(setq x 20))
    => t

Command: call-command command &optional prefix-arg
This function calls the command command interactively. See the documentation of commandp above for what constitutes a command.

If the prefix-argument is non-nil it defines the value of the current-prefix-arg variable for this command, normally the value of this variable would be taken from the global prefix-arg variable.

When called interactively, this function will prompt for a command to invoke. This function is bound to the key sequence Meta-x.


Go to the first, previous, next, last section, table of contents.