Next: , Up: Commands   [Contents][Index]

17.1 Command Definition

Function: define-command name fun #!key spec type doc class

Define a command called name (a symbol). The function fun will be called to execute the command.

spec defines how the arguments are passed by the interactive call of the command. See Interactive Calling Specification.

doc is the documentation string associated with the command. If it’s lacking, that of the function fun will be looked up.

Other arguments are mostly for internal use.

type specifies arguments, too. These arguments are statically set in “Bindings” section of the configurator. If type is set, then a lisp expression like (command-name arg1 arg2...) is bound to the key, in contrast to the usual case where command name is bound. (The precise doc is lacking.)

class is a symbol which annotates the command, for example advanced. Users can choose which commands are shown in the configurator according to class. See the documetation of customize-command-classes (see Commands.)

Function: define-command-to-screen name fun #!key spec type doc class

As define-command, but any printed output of fun is sent to the screen, i.e. standard-output is redirected.

Function: autoload-command name module #!key spec type doc class

Record that loading the module called module (a symbol) will provde a command called name.

The keyword values have the same meanings as for define-command. Defining those properties as part of the autoload provides useful feedback to the user without having to do loading.