Next: , Previous: , Up: Introduction   [Contents][Index]


7.1.1 Defining Commands

Macro: defcommand {command-name | (command-name function-name)} lambda-list icommand-doc function-doc {form}*

Defines a command named name. defcommand creates a function to implement the command from the lambda-list and form’s supplied. The lambda-list must specify one required argument, see section invoking-commands-as-functions, which by convention is typically named p. If the caller does not specify function-name, defcommand creates the command name by replacing all spaces with hyphens and appending "-command". Function-doc becomes the documentation for the function and should primarily describe issues involved in calling the command as a function, such as what any additional arguments are. Command-doc becomes the command documentation for the command.

Function: make-command name documentation function

Defines a new command named name, with command documentation documentation and function function. The command in entered in the string-table command-names, with the command object as its value. Normally command implementors will use the defcommand macro, but this permits access to the command definition mechanism at a lower level, which is occasionally useful.

Function: commandp command

Returns t if command is a command object, otherwise nil.

Function: command-documentation command
Function: command-function command
Function: command-name command

Returns the documentation, function, or name for command. These may be set with setf.


Next: Command Documentation, Previous: Introduction, Up: Introduction   [Contents][Index]