13.1 The Template for a Definition

@deffn category name arguments...
body-of-definition
@end deffn

The @deffn command is used for definitions of entities that resemble functions—entities that may take arguments. Write the @deffn command at the beginning of a line and follow it on the same line by the category of the entity, the name of the entity itself, and its arguments (if any). Then write the body of the definition on succeeding lines. Finally, end the definition with an @end deffn command written on a line of its own.

For example,

@deffn Command forward-word count
This command moves point forward @var{count} words
(or backward if @var{count} is negative). ...
@end deffn

produces

Command: forward-word count

This command moves point forward count words (or backward if count is negative). …

Capitalize the category name like a title. If the name of the category contains spaces, as in the phrase ‘Interactive Command’, enclose it in braces. For example:

@deffn {Interactive Command} isearch-forward
...
@end deffn

Otherwise, the second word will be mistaken for the name of the entity. As a general rule, when any of the arguments in the heading line except the last one are more than one word, you need to enclose them in braces. This may also be necessary if the text contains commands, for example, ‘{declaraci@'on}’ if you are writing in Spanish.

The category is output in a different location for different output formats. For example, in the Info file, the category appears at the beginning of the first line of the definition. With TeX output, the category is printed next to the right margin.

@deffn enters names into the index of functions.

Three predefined, specialized variations of @deffn (@defun, @defmac, and @defspec) specify the category for you: “Function”, “Macro”, and “Special Form” respectively. (In Lisp, a special form is an entity much like a function.) Similarly, the general @defvr command is accompanied by several specialized variations for describing particular kinds of variables.