The way that the user tells Hemlock to do something is by invoking a command. Commands have three attributes: [annotate]
Holds a string-table (page 16.1) associating command names to command objects. Whenever a new command is defined it is entered in this table. [annotate] |
| defcommand | command-name command-name function-name lambda-list command-doc function-doc form | [Macro] |
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 7.4, 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. [annotate] |
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. [annotate] |
Returns t if command is a command object, otherwise nil. [annotate] |
| command-documentation | command | [Function] |
| command-function | command | [Function] |
| command-name | command | [Function] |
Returns the documentation, function, or name for command. These may be set with setf. [annotate] |
Command documentation is a description of what the command does when it is invoked as an extended command or from a key. Command documentation may be either a string or a function. If the documentation is a string then the first line should briefly summarize the command, with remaining lines filling the details. Example: defcommand "Forward Character" (p "Move the point forward one character. With prefix argument move that many characters, with negative argument go backwards." "Move the point of the current buffer forward p characters." . . .) [annotate]
Command documentation may also be a function of one argument. The function is called with either :short or :full, indicating that the function should return a short documentation string or do something to document the command fully. [annotate]