Next: Interactive Calling Specification, Previous: Old-style Command Definition, Up: Commands
The new syntax does not depend on special magic in defun.
Instead, it uses keyword arguments to indicate the calling
specification and other properties.
Define a window managed command called name (a symbol). The function fun will be called to execute the command.
spec and type may be used to define the arguments expected by the command; spec is an interactive specification and type is a custom-type specification. See Interactive Calling Specification.
doc is the documentation string associated with the command. The command-documentation may be stored in the doc file, rather than in the code itself; if it exists, the doc-key will be used to look up the doc file entry. If both arguments are provided, both will be stored. But the
command-documentationfunction favors the built-in doc string over the doc file entry.class is an annotation for the command. It allows the definition to mark the class as
'advanced, for example. Other parts of Sawfish can then take advantage of this note.
As
define-command, but any printed output of fun is sent to the screen.
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.