| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
16.5.1 Functions and Similar Entities
This section describes the commands for describing functions and similar entities:
@deffn category name arguments…The
@deffncommand is the general definition command for functions, interactive commands, and similar entities that may take arguments. You must choose a term to describe the category of entity being defined; for example, “Function” could be used if the entity is a function. The@deffncommand is written at the beginning of a line and is followed on the same line by the category of entity being described, the name of this particular entity, and its arguments, if any. Terminate the definition with@end deffnon a line of its own.For example, here is a definition:
@deffn Command forward-char nchars Move point forward @var{nchars} characters. @end deffnThis shows a rather terse definition for a “command” named
forward-charwith one argument, nchars.@deffnprints argument names such as nchars in slanted type in the printed output, because we think of these names as metasyntactic variables—they stand for the actual argument values. Within the text of the description, however, write an argument name explicitly with@varto refer to the value of the argument. In the example above, we used ‘@var{nchars}’ in this way.In the extremely unusual case when an argument name contains ‘--’, or another character sequence which is treated specially (see section General Syntactic Conventions), use
@codearound the special characters. This avoids the conversion to typographic en-dashes and em-dashes.The template for
@deffnis:@deffn category name arguments… body-of-definition @end deffn
@defun name arguments…The
@defuncommand is the definition command for functions.@defunis equivalent to ‘@deffn Function …’. Terminate the definition with@end defunon a line of its own. Thus, the template is:@defun function-name arguments… body-of-definition @end defun
@defmac name arguments…The
@defmaccommand is the definition command for macros.@defmacis equivalent to ‘@deffn Macro …’ and works like@defun.@defspec name arguments…The
@defspeccommand is the definition command for special forms. (In Lisp, a special form is an entity much like a function; see Special Forms in GNU Emacs Lisp Reference Manual.)@defspecis equivalent to ‘@deffn {Special Form} …’ and works like@defun.
All these commands create entries in the index of functions.
| [ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
This document was generated on October 2, 2013 using texi2html 5.0.
