This is texinfo, produced by makeinfo version 4.2 from texinfo.txi.

This manual is for GNU Texinfo (version 4.2, 28 March 2002), a
documentation system that can produce both online information and a
printed manual from a single source.

  Copyright (C) 1988, 90, 91, 92, 93, 95, 96, 97, 98, 99, 2000, 01, 02
Free Software Foundation, Inc.

     Permission is granted to copy, distribute and/or modify this
     document under the terms of the GNU Free Documentation License,
     Version 1.1 or any later version published by the Free Software
     Foundation; with no Invariant Sections, with the Front-Cover texts
     being "A GNU Manual," and with the Back-Cover Texts as in (a)
     below.  A copy of the license is included in the section entitled
     "GNU Free Documentation License."

     (a) The FSF's Back-Cover Text is: "You have freedom to copy and
     modify this GNU Manual, like GNU software.  Copies published by
     the Free Software Foundation raise funds for GNU development."
  
INFO-DIR-SECTION Texinfo documentation system
START-INFO-DIR-ENTRY
* Texinfo: (texinfo).           The GNU documentation format.
* install-info: (texinfo)Invoking install-info. Update info/dir entries.
* texi2dvi: (texinfo)Format with texi2dvi.      Print Texinfo documents.
* texindex: (texinfo)Format with tex/texindex.  Sort Texinfo index files.
* makeinfo: (texinfo)Invoking makeinfo.         Translate Texinfo source.
END-INFO-DIR-ENTRY


File: texinfo,  Node: Glyphs,  Next: Footnotes,  Prev: math,  Up: Insertions

Glyphs for Examples
===================

  In Texinfo, code is often illustrated in examples that are delimited
by `@example' and `@end example', or by `@lisp' and `@end lisp'.  In
such examples, you can indicate the results of evaluation or an
expansion using `=>' or `==>'.  Likewise, there are commands to insert
glyphs to indicate printed output, error messages, equivalence of
expressions, and the location of point.

  The glyph-insertion commands do not need to be used within an
example, but most often they are.  Every  glyph-insertion command is
followed by a pair of left- and right-hand braces.

* Menu:

* Glyphs Summary::
* result::                      How to show the result of expression.
* expansion::                   How to indicate an expansion.
* Print Glyph::                 How to indicate printed output.
* Error Glyph::                 How to indicate an error message.
* Equivalence::                 How to indicate equivalence.
* Point Glyph::                 How to indicate the location of point.


File: texinfo,  Node: Glyphs Summary,  Next: result,  Up: Glyphs

Glyphs Summary
--------------

  Here are the different glyph commands:

=>
     `@result{}' points to the result of an expression.

==>
     `@expansion{}' shows the results of a macro expansion.

-|
     `@print{}' indicates printed output.

error-->
     `@error{}' indicates that the following text is an error message.

==
     `@equiv{}' indicates the exact equivalence of two forms.

-!-
     `@point{}' shows the location of point.

* Menu:

* result::
* expansion::
* Print Glyph::
* Error Glyph::
* Equivalence::
* Point Glyph::


File: texinfo,  Node: result,  Next: expansion,  Prev: Glyphs Summary,  Up: Glyphs

`@result{}' (=>): Indicating Evaluation
---------------------------------------

  Use the `@result{}' command to indicate the result of evaluating an
expression.

  The `@result{}' command is displayed as `=>' in Info and as a double
stemmed arrow in the printed output.

  Thus, the following,

     (cdr '(1 2 3))
          => (2 3)

may be read as "`(cdr '(1 2 3))' evaluates to `(2 3)'".


File: texinfo,  Node: expansion,  Next: Print Glyph,  Prev: result,  Up: Glyphs

`@expansion{}' (==>): Indicating an Expansion
---------------------------------------------

  When an expression is a macro call, it expands into a new expression.
You can indicate the result of the expansion with the `@expansion{}'
command.

  The `@expansion{}' command is displayed as `==>' in Info and as a
long arrow with a flat base in the printed output.

  For example, the following

     @lisp
     (third '(a b c))
          @expansion{} (car (cdr (cdr '(a b c))))
          @result{} c
     @end lisp

produces

     (third '(a b c))
          ==> (car (cdr (cdr '(a b c))))
          => c

which may be read as:

     `(third '(a b c))' expands to `(car (cdr (cdr '(a b c))))'; the
     result of evaluating the expression is `c'.

Often, as in this case, an example looks better if the `@expansion{}'
and `@result{}' commands are indented five spaces.


File: texinfo,  Node: Print Glyph,  Next: Error Glyph,  Prev: expansion,  Up: Glyphs

`@print{}' (-|): Indicating Printed Output
------------------------------------------

  Sometimes an expression will print output during its execution.  You
can indicate the printed output with the `@print{}' command.

  The `@print{}' command is displayed as `-|' in Info and similarly, as
a horizontal dash butting against a vertical bar, in the printed output.

  In the following example, the printed text is indicated with `-|',
and the value of the expression follows on the last line.

     (progn (print 'foo) (print 'bar))
          -| foo
          -| bar
          => bar

In a Texinfo source file, this example is written as follows:

     @lisp
     (progn (print 'foo) (print 'bar))
          @print{} foo
          @print{} bar
          @result{} bar
     @end lisp


File: texinfo,  Node: Error Glyph,  Next: Equivalence,  Prev: Print Glyph,  Up: Glyphs

`@error{}' (error-->): Indicating an Error Message
--------------------------------------------------

  A piece of code may cause an error when you evaluate it.  You can
designate the error message with the `@error{}' command.

  The `@error{}' command is displayed as `error-->' in Info and as the
word `error' in a box in the printed output.

  Thus,

     @lisp
     (+ 23 'x)
     @error{} Wrong type argument: integer-or-marker-p, x
     @end lisp

produces

     (+ 23 'x)
     error--> Wrong type argument: integer-or-marker-p, x

This indicates that the following error message is printed when you
evaluate the expression:

     Wrong type argument: integer-or-marker-p, x

  `error-->' itself is not part of the error message.


File: texinfo,  Node: Equivalence,  Next: Point Glyph,  Prev: Error Glyph,  Up: Glyphs

`@equiv{}' (==): Indicating Equivalence
---------------------------------------

  Sometimes two expressions produce identical results.  You can
indicate the exact equivalence of two forms with the `@equiv{}' command.

  The `@equiv{}' command is displayed as `==' in Info and as a three
parallel horizontal lines in the printed output.

  Thus,

     @lisp
     (make-sparse-keymap) @equiv{} (list 'keymap)
     @end lisp

produces

     (make-sparse-keymap) == (list 'keymap)

This indicates that evaluating `(make-sparse-keymap)' produces
identical results to evaluating `(list 'keymap)'.


File: texinfo,  Node: Point Glyph,  Prev: Equivalence,  Up: Glyphs

`@point{}' (-!-): Indicating Point in a Buffer
----------------------------------------------

  Sometimes you need to show an example of text in an Emacs buffer.  In
such examples, the convention is to include the entire contents of the
buffer in question between two lines of dashes containing the buffer
name.

  You can use the `@point{}' command to show the location of point in
the text in the buffer.  (The symbol for point, of course, is not part
of the text in the buffer; it indicates the place _between_ two
characters where point is located.)

  The `@point{}' command is displayed as `-!-' in Info and as a small
five pointed star in the printed output.

  The following example shows the contents of buffer `foo' before and
after evaluating a Lisp command to insert the word `changed'.

     ---------- Buffer: foo ----------
     This is the -!-contents of foo.
     ---------- Buffer: foo ----------

     (insert "changed ")
          => nil
     ---------- Buffer: foo ----------
     This is the changed -!-contents of foo.
     ---------- Buffer: foo ----------

  In a Texinfo source file, the example is written like this:

     @example
     ---------- Buffer: foo ----------
     This is the @point{}contents of foo.
     ---------- Buffer: foo ----------
     
     (insert "changed ")
          @result{} nil
     ---------- Buffer: foo ----------
     This is the changed @point{}contents of foo.
     ---------- Buffer: foo ----------
     @end example


File: texinfo,  Node: Footnotes,  Next: Images,  Prev: Glyphs,  Up: Insertions

Footnotes
=========

  A "footnote" is for a reference that documents or elucidates the
primary text.(1) (*note Footnotes-Footnote-1::)

* Menu:

* Footnote Commands::           How to write a footnote in Texinfo.
* Footnote Styles::             Controlling how footnotes appear in Info.


File: texinfo,  Node: Footnotes-Footnotes,  Up: Footnotes

  (1) A footnote should complement or expand upon the primary text, but
a reader should not need to read a footnote to understand the primary
text.  For a thorough discussion of footnotes, see `The Chicago Manual
of Style', which is published by the University of Chicago Press.


File: texinfo,  Node: Footnote Commands,  Next: Footnote Styles,  Up: Footnotes

Footnote Commands
-----------------

  In Texinfo, footnotes are created with the `@footnote' command.  This
command is followed immediately by a left brace, then by the text of
the footnote, and then by a terminating right brace.  Footnotes may be
of any length (they will be broken across pages if necessary), but are
usually short.  The template is:

     ordinary text@footnote{TEXT OF FOOTNOTE}

  As shown here, the `@footnote' command should come right after the
text being footnoted, with no intervening space; otherwise, the footnote
marker might end up starting a line.

  For example, this clause is followed by a sample footnote(1) (*note
Footnote Commands-Footnote-1::); in the Texinfo source, it looks like
this:

     ...a sample footnote@footnote{Here is the sample
     footnote.}; in the Texinfo source...

  As you can see, the source includes two punctuation marks next to each
other; in this case, `.};' is the sequence.  This is normal (the first
ends the footnote and the second belongs to the sentence being
footnoted), so don't worry that it looks odd.

  In a printed manual or book, the reference mark for a footnote is a
small, superscripted number; the text of the footnote appears at the
bottom of the page, below a horizontal line.

  In Info, the reference mark for a footnote is a pair of parentheses
with the footnote number between them, like this: `(1)'.  The reference
mark is followed by a cross-reference link to the footnote's text.

  In the HTML output, footnote references are marked with a small,
superscripted number which is rendered as a hypertext link to the
footnote text.

  By the way, footnotes in the argument of an `@item' command for a
`@table' must be on the same line as the `@item' (as usual).  *Note
Two-column Tables::.


File: texinfo,  Node: Footnote Commands-Footnotes,  Up: Footnote Commands

  (1) Here is the sample footnote.


File: texinfo,  Node: Footnote Styles,  Prev: Footnote Commands,  Up: Footnotes

Footnote Styles
---------------

  Info has two footnote styles, which determine where the text of the
footnote is located:

   * In the `End' node style, all the footnotes for a single node are
     placed at the end of that node.  The footnotes are separated from
     the rest of the node by a line of dashes with the word `Footnotes'
     within it.  Each footnote begins with an `(N)' reference mark.

     Here is an example of a single footnote in the end of node style:

           --------- Footnotes ---------
          
          (1)  Here is a sample footnote.

   * In the `Separate' node style, all the footnotes for a single node
     are placed in an automatically constructed node of their own.  In
     this style, a "footnote reference" follows each `(N)' reference
     mark in the body of the node.  The footnote reference is actually
     a cross reference which you use to reach the footnote node.

     The name of the node with the footnotes is constructed by
     appending `-Footnotes' to the name of the node that contains the
     footnotes. (Consequently, the footnotes' node for the `Footnotes'
     node is `Footnotes-Footnotes'!)  The footnotes' node has an `Up'
     node pointer that leads back to its parent node.

     Here is how the first footnote in this manual looks after being
     formatted for Info in the separate node style:

          File: texinfo.info  Node: Overview-Footnotes, Up: Overview
          
          (1) The first syllable of "Texinfo" is pronounced like "speck", not
          "hex". ...

  A Texinfo file may be formatted into an Info file with either footnote
style.

  Use the `@footnotestyle' command to specify an Info file's footnote
style.  Write this command at the beginning of a line followed by an
argument, either `end' for the end node style or `separate' for the
separate node style.

  For example,

     @footnotestyle end

or
     @footnotestyle separate

  Write an `@footnotestyle' command before or shortly after the
end-of-header line at the beginning of a Texinfo file.  (If you include
the `@footnotestyle' command between the start-of-header and
end-of-header lines, the region formatting commands will format
footnotes as specified.)

  If you do not specify a footnote style, the formatting commands use
their default style.  Currently, `texinfo-format-buffer' and
`texinfo-format-region' use the `separate' style and `makeinfo' uses
the `end' style.

  This chapter contains two footnotes.


File: texinfo,  Node: Images,  Prev: Footnotes,  Up: Insertions

Inserting Images
================

  You can insert an image given in an external file with the `@image'
command:

     @image{FILENAME, [WIDTH], [HEIGHT], [ALTTEXT], [EXTENSION]}

  The FILENAME argument is mandatory, and must not have an extension,
because the different processors support different formats:
   * TeX reads the file `FILENAME.eps' (Encapsulated PostScript format).

   * PDFTeX reads `FILENAME.pdf' (Adobe's Portable Document Format).

   * `makeinfo' uses `FILENAME.txt' verbatim for Info output (more or
     less as if it was an `@example').

   * `makeinfo' uses the optional fifth argument to `@image' for the
     extension if you supply it.  For example:

          @image{foo,,,,xpm}

     will cause `makeinfo --html' to try `foo.xpm'.

     If you do not supply the optional fifth argument, `makeinfo
     ---html' first tries `FILENAME.png'; if that does not exist, it
     tries `FILENAME.jpg'.  If that does not exist either, it
     complains.  (We cannot support GIF format directly due to software
     patents.)

  The optional WIDTH and HEIGHT arguments specify the size to scale the
image to (they are ignored for Info output).  If neither is specified,
the image is presented in its natural size (given in the file); if only
one is specified, the other is scaled proportionately; and if both are
specified, both are respected, thus possibly distorting the original
image by changing its aspect ratio.

  The WIDTH and HEIGHT may be specified using any valid TeX dimension,
namely:

pt
     point (72.27pt = 1in)

pc
     pica (1pc = 12pt)

bp
     big point (72bp = 1in)

in
     inch

cm
     centimeter (2.54cm = 1in)

mm
     millimeter (10mm = 1cm)

dd
     dido^t point (1157dd = 1238pt)

cc
     cicero (1cc = 12dd)

sp
     scaled point (65536sp = 1pt)

  For example, the following will scale a file `ridt.eps' to one inch
vertically, with the width scaled proportionately:

     @image{ridt,,1in}

  For `@image' to work with TeX, the file `epsf.tex' must be installed
somewhere that TeX can find it.  (The standard location is
`TEXMF/tex/generic/dvips/epsf.tex', where TEXMF is a root of your TeX
directory tree.)  This file is included in the Texinfo distribution and
is also available from `ftp://tug.org/tex/epsf.tex', among other places.

  `@image' can be used within a line as well as for displayed figures.
Therefore, if you intend it to be displayed, be sure to leave a blank
line before the command, or the output will run into the preceding text.

  When producing html, `makeinfo' sets the "alt attribute" for inline
images to the optional fourth argument to `@image', if supplied.  If
not supplied, `makeinfo' uses the full file name of the image being
displayed.


File: texinfo,  Node: Breaks,  Next: Definition Commands,  Prev: Insertions,  Up: Top

Making and Preventing Breaks
****************************

  Usually, a Texinfo file is processed both by TeX and by one of the
Info formatting commands.  Line, paragraph, or page breaks sometimes
occur in the `wrong' place in one or other form of output.  You must
ensure that text looks right both in the printed manual and in the Info
file.

  For example, in a printed manual, page breaks may occur awkwardly in
the middle of an example; to prevent this, you can hold text together
using a grouping command that keeps the text from being split across
two pages.  Conversely, you may want to force a page break where none
would occur normally.  Fortunately, problems like these do not often
arise.  When they do, use the break, break prevention, or pagination
commands.

* Menu:

* Break Commands::              Cause and prevent splits.
* Line Breaks::                 How to force a single line to use two lines.
* - and hyphenation::           How to tell TeX about hyphenation points.
* w::                           How to prevent unwanted line breaks.
* sp::                          How to insert blank lines.
* page::                        How to force the start of a new page.
* group::                       How to prevent unwanted page breaks.
* need::                        Another way to prevent unwanted page breaks.


File: texinfo,  Node: Break Commands,  Next: Line Breaks,  Prev: Breaks,  Up: Breaks

Break Commands
==============

  The break commands create or allow line and paragraph breaks:

`@*'
     Force a line break.

`@sp N'
     Skip N blank lines.

`@-'
     Insert a discretionary hyphen.

`@hyphenation{HY-PHEN-A-TED WORDS}'
     Define hyphen points in HY-PHEN-A-TED WORDS.

  The line-break-prevention command holds text together all on one line:

`@w{TEXT}'
     Prevent TEXT from being split and hyphenated across two lines.

  The pagination commands apply only to printed output, since Info
files do not have pages.

`@page'
     Start a new page in the printed manual.

`@group'
     Hold text together that must appear on one printed page.

`@need MILS'
     Start a new printed page if not enough space on this one.


File: texinfo,  Node: Line Breaks,  Next: - and hyphenation,  Prev: Break Commands,  Up: Breaks

`@*': Generate Line Breaks
==========================

  The `@*' command forces a line break in both the printed manual and
in Info.

  For example,

     This line @* is broken @*in two places.

produces

     This line
      is broken
     in two places.

(Note that the space after the first `@*' command is faithfully carried
down to the next line.)

  The `@*' command is often used in a file's copyright page:

     This is edition 2.0 of the Texinfo documentation,@*
     and is for ...

In this case, the `@*' command keeps TeX from stretching the line
across the whole page in an ugly manner.

     *Please note:* Do not write braces after an `@*' command; they are
     not needed.

     Do not write an `@refill' command at the end of a paragraph
     containing an `@*' command; it will cause the paragraph to be
     refilled after the line break occurs, negating the effect of the
     line break.


File: texinfo,  Node: - and hyphenation,  Next: w,  Prev: Line Breaks,  Up: Breaks

`@-' and `@hyphenation': Helping TeX hyphenate
==============================================

  Although TeX's hyphenation algorithm is generally pretty good, it
does miss useful hyphenation points from time to time.  (Or, far more
rarely, insert an incorrect hyphenation.)  So, for documents with an
unusual vocabulary or when fine-tuning for a printed edition, you may
wish to help TeX out.  Texinfo supports two commands for this:

`@-'
     Insert a discretionary hyphen, i.e., a place where TeX can (but
     does not have to) hyphenate.  This is especially useful when you
     notice an overfull hbox is due to TeX missing a hyphenation (*note
     Overfull hboxes::).  TeX will not insert any hyphenation points
     itself into a word containing `@-'.

`@hyphenation{HY-PHEN-A-TED WORDS}'
     Tell TeX how to hyphenate HY-PHEN-A-TED WORDS.  As shown, you put
     a `-' at each hyphenation point.  For example:
          @hyphenation{man-u-script man-u-scripts}
      TeX only uses the specified hyphenation points when the words
     match exactly, so give all necessary variants.

  Info output is not hyphenated, so these commands have no effect there.


File: texinfo,  Node: w,  Next: sp,  Prev: - and hyphenation,  Up: Breaks

`@w'{TEXT}: Prevent Line Breaks
===============================

  `@w{TEXT}' outputs TEXT and prohibits line breaks within TEXT.

  You can use the `@w' command to prevent TeX from automatically
hyphenating a long name or phrase that happens to fall near the end of a
line.  For example:

     You can copy GNU software from @w{@samp{ftp.gnu.org}}.

produces

     You can copy GNU software from `ftp.gnu.org'.

  You can also use `@w' to produce a non-breakable space:

     None of the formatters will break at this@w{ }space.


File: texinfo,  Node: sp,  Next: page,  Prev: w,  Up: Breaks

`@sp' N: Insert Blank Lines
===========================

  A line beginning with and containing only `@sp N' generates N blank
lines of space in both the printed manual and the Info file.  `@sp'
also forces a paragraph break.  For example,

     @sp 2

generates two blank lines.

  The `@sp' command is most often used in the title page.


File: texinfo,  Node: page,  Next: group,  Prev: sp,  Up: Breaks

`@page': Start a New Page
=========================

  A line containing only `@page' starts a new page in a printed manual.
The command has no effect on Info files since they are not paginated.
An `@page' command is often used in the `@titlepage' section of a
Texinfo file to start the copyright page.


File: texinfo,  Node: group,  Next: need,  Prev: page,  Up: Breaks

`@group': Prevent Page Breaks
=============================

  The `@group' command (on a line by itself) is used inside an
`@example' or similar construct to begin an unsplittable vertical
group, which will appear entirely on one page in the printed output.
The group is terminated by a line containing only `@end group'.  These
two lines produce no output of their own, and in the Info file output
they have no effect at all.

  Although `@group' would make sense conceptually in a wide variety of
contexts, its current implementation works reliably only within
`@example' and variants, and within `@display', `@format', `@flushleft'
and `@flushright'.  *Note Quotations and Examples::.  (What all these
commands have in common is that each line of input produces a line of
output.)  In other contexts, `@group' can cause anomalous vertical
spacing.

  This formatting requirement means that you should write:

     @example
     @group
     ...
     @end group
     @end example

with the `@group' and `@end group' commands inside the `@example' and
`@end example' commands.

  The `@group' command is most often used to hold an example together
on one page.  In this Texinfo manual, more than 100 examples contain
text that is enclosed between `@group' and `@end group'.

  If you forget to end a group, you may get strange and unfathomable
error messages when you run TeX.  This is because TeX keeps trying to
put the rest of the Texinfo file onto the one page and does not start
to generate error messages until it has processed considerable text.
It is a good rule of thumb to look for a missing `@end group' if you
get incomprehensible error messages in TeX.


File: texinfo,  Node: need,  Prev: group,  Up: Breaks

`@need MILS': Prevent Page Breaks
=================================

  A line containing only `@need N' starts a new page in a printed
manual if fewer than N mils (thousandths of an inch) remain on the
current page.  Do not use braces around the argument N.  The `@need'
command has no effect on Info files since they are not paginated.

  This paragraph is preceded by an `@need' command that tells TeX to
start a new page if fewer than 800 mils (eight-tenths inch) remain on
the page.  It looks like this:

     @need 800
     This paragraph is preceded by ...

  The `@need' command is useful for preventing orphans (single lines at
the bottoms of printed pages).


File: texinfo,  Node: Definition Commands,  Next: Conditionals,  Prev: Breaks,  Up: Top

Definition Commands
*******************

  The `@deffn' command and the other "definition commands" enable you
to describe functions, variables, macros, commands, user options,
special forms and other such artifacts in a uniform format.

  In the Info file, a definition causes the entity
category--`Function', `Variable', or whatever--to appear at the
beginning of the first line of the definition, followed by the entity's
name and arguments.  In the printed manual, the command causes TeX to
print the entity's name and its arguments on the left margin and print
the category next to the right margin.  In both output formats, the
body of the definition is indented.  Also, the name of the entity is
entered into the appropriate index: `@deffn' enters the name into the
index of functions, `@defvr' enters it into the index of variables, and
so on.

  A manual need not and should not contain more than one definition for
a given name.  An appendix containing a summary should use `@table'
rather than the definition commands.

* Menu:

* Def Cmd Template::            How to structure a description using a
                                  definition command.
* Optional Arguments::          How to handle optional and repeated arguments.
* deffnx::                      How to group two or more `first' lines.
* Def Cmds in Detail::          All the definition commands.
* Def Cmd Conventions::         Conventions for writing definitions.
* Sample Function Definition::


File: texinfo,  Node: Def Cmd Template,  Next: Optional Arguments,  Prev: Definition Commands,  Up: Definition Commands

The Template for a Definition
=============================

  The `@deffn' command is used for definitions of entities that
resemble functions.  To write a definition using the `@deffn' command,
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.  (You may embed examples in the body.)
Finally, end the definition with an `@end deffn' command written on a
line of its own.  (The other definition commands follow the same
format.)

  The template for a definition looks like this:

     @deffn CATEGORY NAME ARGUMENTS...
     BODY-OF-DEFINITION
     @end deffn

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 function 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', write
braces around it.  For example:

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

Otherwise, the second word will be mistaken for the name of the entity.

  Some of the definition commands are more general than others.  The
`@deffn' command, for example, is the general definition command for
functions and the like--for entities that may take arguments.  When you
use this command, you specify the category to which the entity belongs.
The `@deffn' command possesses three predefined, specialized
variations, `@defun', `@defmac', and `@defspec', that specify the
category for you: "Function", "Macro", and "Special Form" respectively.
(In Lisp, a special form is an entity much like a function.)  The
`@defvr' command also is accompanied by several predefined, specialized
variations for describing particular kinds of variables.

  The template for a specialized definition, such as `@defun', is
similar to the template for a generalized definition, except that you
do not need to specify the category:

     @defun NAME ARGUMENTS...
     BODY-OF-DEFINITION
     @end defun

Thus,

     @defun buffer-end flag
     This function returns @code{(point-min)} if @var{flag}
     is less than 1, @code{(point-max)} otherwise.
     ...
     @end defun

produces

      - Function: buffer-end flag
          This function returns `(point-min)' if FLAG is less than 1,
          `(point-max)' otherwise.  ...

*Note Sample Function Definition: Sample Function Definition, for a
more detailed example of a function definition, including the use of
`@example' inside the definition.

  The other specialized commands work like `@defun'.

  Note that, due to implementation difficulties, macros are not expanded
in `@deffn' and all the other definition commands.


File: texinfo,  Node: Optional Arguments,  Next: deffnx,  Prev: Def Cmd Template,  Up: Definition Commands

Optional and Repeated Arguments
===============================

  Some entities take optional or repeated arguments, which may be
specified by a distinctive glyph that uses square brackets and
ellipses.  For example, a special form often breaks its argument list
into separate arguments in more complicated ways than a straightforward
function.

  An argument enclosed within square brackets is optional.  Thus,
[OPTIONAL-ARG] means that OPTIONAL-ARG is optional.  An argument
followed by an ellipsis is optional and may be repeated more than once.
Thus, REPEATED-ARGS... stands for zero or more arguments.  Parentheses
are used when several arguments are grouped into additional levels of
list structure in Lisp.

  Here is the `@defspec' line of an example of an imaginary special
form:

      - Special Form: foobar (VAR [FROM TO [INC]]) BODY...

In this example, the arguments FROM and TO are optional, but must both
be present or both absent.  If they are present, INC may optionally be
specified as well.  These arguments are grouped with the argument VAR
into a list, to distinguish them from BODY, which includes all
remaining elements of the form.

  In a Texinfo source file, this `@defspec' line is written like this
(except it would not be split over two lines, as it is in this example).

     @defspec foobar (@var{var} [@var{from} @var{to}
          [@var{inc}]]) @var{body}@dots{}

The function is listed in the Command and Variable Index under `foobar'.


File: texinfo,  Node: deffnx,  Next: Def Cmds in Detail,  Prev: Optional Arguments,  Up: Definition Commands

Two or More `First' Lines
=========================

  To create two or more `first' or header lines for a definition, follow
the first `@deffn' line by a line beginning with `@deffnx'.  The
`@deffnx' command works exactly like `@deffn' except that it does not
generate extra vertical white space between it and the preceding line.

  For example,

     @deffn {Interactive Command} isearch-forward
     @deffnx {Interactive Command} isearch-backward
     These two search commands are similar except ...
     @end deffn

produces

 - Interactive Command: isearch-forward
 - Interactive Command: isearch-backward
     These two search commands are similar except ...

  Each definition command has an `x' form: `@defunx', `@defvrx',
`@deftypefunx', etc.

  The `x' forms work just like `@itemx'; see *Note `@itemx': itemx.


File: texinfo,  Node: Def Cmds in Detail,  Next: Def Cmd Conventions,  Prev: deffnx,  Up: Definition Commands

The Definition Commands
=======================

  Texinfo provides more than a dozen definition commands, all of which
are described in this section.

  The definition commands automatically enter the name of the entity in
the appropriate index: for example, `@deffn', `@defun', and `@defmac'
enter function names in the index of functions; `@defvr' and `@defvar'
enter variable names in the index of variables.

  Although the examples that follow mostly illustrate Lisp, the commands
can be used for other programming languages.

* Menu:

* Functions Commands::          Commands for functions and similar entities.
* Variables Commands::          Commands for variables and similar entities.
* Typed Functions::             Commands for functions in typed languages.
* Typed Variables::             Commands for variables in typed languages.
* Abstract Objects::            Commands for object-oriented programming.
* Data Types::                  The definition command for data types.


File: texinfo,  Node: Functions Commands,  Next: Variables Commands,  Prev: Def Cmds in Detail,  Up: Def Cmds in Detail

Functions and Similar Entities
------------------------------

  This section describes the commands for describing functions and
similar entities:

`@deffn CATEGORY NAME ARGUMENTS...'
     The `@deffn' command 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 `@deffn' command 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 deffn' on a line of its own.

     For example, here is a definition:

          @deffn Command forward-char nchars
          Move point forward @var{nchars} characters.
          @end deffn

     This shows a rather terse definition for a "command" named
     `forward-char' with one argument, NCHARS.

     `@deffn' prints argument names such as NCHARS in italics or upper
     case, as if `@var' had been used, because we think of these names
     as metasyntactic variables--they stand for the actual argument
     values.  Within the text of the description, write an argument name
     explicitly with `@var' to refer to the value of the argument.  In
     the example above, we used `@var{nchars}' in this way.

     The template for `@deffn' is:

          @deffn CATEGORY NAME ARGUMENTS...
          BODY-OF-DEFINITION
          @end deffn

`@defun NAME ARGUMENTS...'
     The `@defun' command is the definition command for functions.
     `@defun' is equivalent to `@deffn Function ...'.

     For example,

          @defun set symbol new-value
          Change the value of the symbol @var{symbol}
          to @var{new-value}.
          @end defun

     shows a rather terse definition for a function `set' whose
     arguments are SYMBOL and NEW-VALUE.  The argument names on the
     `@defun' line automatically appear in italics or upper case as if
     they were enclosed in `@var'.  Terminate the definition with `@end
     defun' on a line of its own.

     The template is:

          @defun FUNCTION-NAME ARGUMENTS...
          BODY-OF-DEFINITION
          @end defun

     `@defun' creates an entry in the index of functions.

`@defmac NAME ARGUMENTS...'
     The `@defmac' command is the definition command for macros.
     `@defmac' is equivalent to `@deffn Macro ...' and works like
     `@defun'.

`@defspec NAME ARGUMENTS...'
     The `@defspec' command is the definition command for special
     forms.  (In Lisp, a special form is an entity much like a function,
     *note Special Forms: (elisp)Special Forms..)  `@defspec' is
     equivalent to `@deffn {Special Form} ...' and works like `@defun'.


File: texinfo,  Node: Variables Commands,  Next: Typed Functions,  Prev: Functions Commands,  Up: Def Cmds in Detail

Variables and Similar Entities
------------------------------

  Here are the commands for defining variables and similar entities:

`@defvr CATEGORY NAME'
     The `@defvr' command is a general definition command for something
     like a variable--an entity that records a value.  You must choose
     a term to describe the category of entity being defined; for
     example, "Variable" could be used if the entity is a variable.
     Write the `@defvr' command at the beginning of a line and follow
     it on the same line by the category of the entity and the name of
     the entity.

     Capitalize the category name like a title.  If the name of the
     category contains spaces, as in the name "User Option", enclose it
     in braces.  Otherwise, the second word will be mistaken for the
     name of the entity.  For example,

          @defvr {User Option} fill-column
          This buffer-local variable specifies
          the maximum width of filled lines.
          ...
          @end defvr

     Terminate the definition with `@end defvr' on a line of its own.

     The template is:

          @defvr CATEGORY NAME
          BODY-OF-DEFINITION
          @end defvr

     `@defvr' creates an entry in the index of variables for NAME.

`@defvar NAME'
     The `@defvar' command is the definition command for variables.
     `@defvar' is equivalent to `@defvr Variable ...'.

     For example:

          @defvar kill-ring
          ...
          @end defvar

     The template is:

          @defvar NAME
          BODY-OF-DEFINITION
          @end defvar

     `@defvar' creates an entry in the index of variables for NAME.

`@defopt NAME'
     The `@defopt' command is the definition command for "user
     options", i.e., variables intended for users to change according to
     taste; Emacs has many such (*note Variables: (emacs)Variables.).
     `@defopt' is equivalent to `@defvr {User Option} ...' and works
     like `@defvar'.


File: texinfo,  Node: Typed Functions,  Next: Typed Variables,  Prev: Variables Commands,  Up: Def Cmds in Detail

Functions in Typed Languages
----------------------------

  The `@deftypefn' command and its variations are for describing
functions in languages in which you must declare types of variables and
functions, such as C and C++.

`@deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS...'
     The `@deftypefn' command is the general definition command for
     functions and similar entities that may take arguments and that are
     typed.  The `@deftypefn' command is written at the beginning of a
     line and is followed on the same line by the category of entity
     being described, the type of the returned value, the name of this
     particular entity, and its arguments, if any.

     For example,

          @deftypefn {Library Function} int foobar
             (int @var{foo}, float @var{bar})
          ...
          @end deftypefn

     (where the text before the "...", shown above as two lines, would
     actually be a single line in a real Texinfo file) produces the
     following in Info:

          -- Library Function: int foobar (int FOO, float BAR)
          ...

     This means that `foobar' is a "library function" that returns an
     `int', and its arguments are FOO (an `int') and BAR (a `float').

     The argument names that you write in `@deftypefn' are not subject
     to an implicit `@var'--since the actual names of the arguments in
     `@deftypefn' are typically scattered among data type names and
     keywords, Texinfo cannot find them without help.  Instead, you
     must write `@var' explicitly around the argument names.  In the
     example above, the argument names are `foo' and `bar'.

     The template for `@deftypefn' is:

          @deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS ...
          BODY-OF-DESCRIPTION
          @end deftypefn

     Note that if the CATEGORY or DATA TYPE is more than one word then
     it must be enclosed in braces to make it a single argument.

     If you are describing a procedure in a language that has packages,
     such as Ada, you might consider using `@deftypefn' in a manner
     somewhat contrary to the convention described in the preceding
     paragraphs.

     For example:

          @deftypefn stacks private push
                  (@var{s}:in out stack;
                  @var{n}:in integer)
          ...
          @end deftypefn

     (The `@deftypefn' arguments are shown split into three lines, but
     would be a single line in a real Texinfo file.)

     In this instance, the procedure is classified as belonging to the
     package `stacks' rather than classified as a `procedure' and its
     data type is described as `private'.  (The name of the procedure
     is `push', and its arguments are S and N.)

     `@deftypefn' creates an entry in the index of functions for NAME.

`@deftypefun DATA-TYPE NAME ARGUMENTS...'
     The `@deftypefun' command is the specialized definition command
     for functions in typed languages.  The command is equivalent to
     `@deftypefn Function ...'.

     Thus,

          @deftypefun int foobar (int @var{foo}, float @var{bar})
          ...
          @end deftypefun

     produces the following in Info:

          -- Function: int foobar (int FOO, float BAR)
          ...

     The template is:

          @deftypefun TYPE NAME ARGUMENTS...
          BODY-OF-DESCRIPTION
          @end deftypefun

     `@deftypefun' creates an entry in the index of functions for NAME.


File: texinfo,  Node: Typed Variables,  Next: Abstract Objects,  Prev: Typed Functions,  Up: Def Cmds in Detail

Variables in Typed Languages
----------------------------

  Variables in typed languages are handled in a manner similar to
functions in typed languages.  *Note Typed Functions::.  The general
definition command `@deftypevr' corresponds to `@deftypefn' and the
specialized definition command `@deftypevar' corresponds to
`@deftypefun'.

`@deftypevr CATEGORY DATA-TYPE NAME'
     The `@deftypevr' command is the general definition command for
     something like a variable in a typed language--an entity that
     records a value.  You must choose a term to describe the category
     of the entity being defined; for example, "Variable" could be used
     if the entity is a variable.

     The `@deftypevr' command is written at the beginning of a line and
     is followed on the same line by the category of the entity being
     described, the data type, and the name of this particular entity.

     For example:

          @deftypevr {Global Flag} int enable
          ...
          @end deftypevr

     produces the following in Info:

          -- Global Flag: int enable
          ...

     The template is:

          @deftypevr CATEGORY DATA-TYPE NAME
          BODY-OF-DESCRIPTION
          @end deftypevr

     `@deftypevr' creates an entry in the index of variables for NAME.

`@deftypevar DATA-TYPE NAME'
     The `@deftypevar' command is the specialized definition command
     for variables in typed languages.  `@deftypevar' is equivalent to
     `@deftypevr Variable ...'.

     For example:

          @deftypevar int fubar
          ...
          @end deftypevar

     produces the following in Info:

          -- Variable: int fubar
          ...

     The template is:

          @deftypevar DATA-TYPE NAME
          BODY-OF-DESCRIPTION
          @end deftypevar

     `@deftypevar' creates an entry in the index of variables for NAME.


File: texinfo,  Node: Abstract Objects,  Next: Data Types,  Prev: Typed Variables,  Up: Def Cmds in Detail

Object-Oriented Programming
---------------------------

  Here are the commands for formatting descriptions about abstract
objects, such as are used in object-oriented programming.  A class is a
defined type of abstract object.  An instance of a class is a
particular object that has the type of the class.  An instance variable
is a variable that belongs to the class but for which each instance has
its own value.

  In a definition, if the name of a class is truly a name defined in the
programming system for a class, then you should write an `@code' around
it.  Otherwise, it is printed in the usual text font.

`@defcv CATEGORY CLASS NAME'
     The `@defcv' command is the general definition command for
     variables associated with classes in object-oriented programming.
     The `@defcv' command is followed by three arguments: the category
     of thing being defined, the class to which it belongs, and its
     name.  Thus,

          @defcv {Class Option} Window border-pattern
          ...
          @end defcv

     illustrates how you would write the first line of a definition of
     the `border-pattern' class option of the class `Window'.

     The template is:
          @defcv CATEGORY CLASS NAME
          ...
          @end defcv

     `@defcv' creates an entry in the index of variables.

`@defivar CLASS NAME'
     The `@defivar' command is the definition command for instance
     variables in object-oriented programming.  `@defivar' is
     equivalent to `@defcv {Instance Variable} ...'

     The template is:
          @defivar CLASS INSTANCE-VARIABLE-NAME
          BODY-OF-DEFINITION
          @end defivar

     `@defivar' creates an entry in the index of variables.

`@deftypeivar CLASS DATA-TYPE NAME'
     The `@deftypeivar' command is the definition command for typed
     instance variables in object-oriented programming.  It is similar
     to `@defivar' with the addition of the DATA-TYPE parameter to
     specify the type of the instance variable.  `@deftypeivar' creates
     an entry in the index of variables.

`@defop CATEGORY CLASS NAME ARGUMENTS...'
     The `@defop' command is the general definition command for
     entities that may resemble methods in object-oriented programming.
     These entities take arguments, as functions do, but are associated
     with particular classes of objects.

     For example, some systems have constructs called "wrappers" that
     are associated with classes as methods are, but that act more like
     macros than like functions.  You could use `@defop Wrapper' to
     describe one of these.

     Sometimes it is useful to distinguish methods and "operations".
     You can think of an operation as the specification for a method.
     Thus, a window system might specify that all window classes have a
     method named `expose'; we would say that this window system
     defines an `expose' operation on windows in general.  Typically,
     the operation has a name and also specifies the pattern of
     arguments; all methods that implement the operation must accept
     the same arguments, since applications that use the operation do
     so without knowing which method will implement it.

     Often it makes more sense to document operations than methods.  For
     example, window application developers need to know about the
     `expose' operation, but need not be concerned with whether a given
     class of windows has its own method to implement this operation.
     To describe this operation, you would write:

          @defop Operation windows expose

     The `@defop' command is written at the beginning of a line and is
     followed on the same line by the overall name of the category of
     operation, the name of the class of the operation, the name of the
     operation, and its arguments, if any.

     The template is:
          @defop CATEGORY CLASS NAME ARGUMENTS...
          BODY-OF-DEFINITION
          @end defop

     `@defop' creates an entry, such as ``expose' on `windows'', in the
     index of functions.

`@deftypeop CATEGORY CLASS DATA-TYPE NAME ARGUMENTS...'
     The `@deftypeop' command is the definition command for typed
     operations in object-oriented programming.  It is similar to
     `@defop' with the addition of the DATA-TYPE parameter to specify
     the return type of the method.  `@deftypeop' creates an entry in
     the index of functions.

`@defmethod CLASS NAME ARGUMENTS...'
     The `@defmethod' command is the definition command for methods in
     object-oriented programming.  A method is a kind of function that
     implements an operation for a particular class of objects and its
     subclasses.

     `@defmethod' is equivalent to `@defop Method ...'.  The command is
     written at the beginning of a line and is followed by the name of
     the class of the method, the name of the method, and its
     arguments, if any.

     For example:
          @defmethod `bar-class' bar-method argument
          ...
          @end defmethod

     illustrates the definition for a method called `bar-method' of the
     class `bar-class'.  The method takes an argument.

     The template is:

          @defmethod CLASS METHOD-NAME ARGUMENTS...
          BODY-OF-DEFINITION
          @end defmethod

     `@defmethod' creates an entry, such as ``bar-method' on
     `bar-class'', in the index of functions.

`@deftypemethod CLASS DATA-TYPE NAME ARGUMENTS...'
     The `@deftypemethod' command is the definition command for methods
     in object-oriented typed languages, such as C++ and Java.  It is
     similar to the `@defmethod' command with the addition of the
     DATA-TYPE parameter to specify the return type of the method.


File: texinfo,  Node: Data Types,  Prev: Abstract Objects,  Up: Def Cmds in Detail

Data Types
----------

  Here is the command for data types:

`@deftp CATEGORY NAME ATTRIBUTES...'
     The `@deftp' command is the generic definition command for data
     types.  The command is written at the beginning of a line and is
     followed on the same line by the category, by the name of the type
     (which is a word like `int' or `float'), and then by names of
     attributes of objects of that type.  Thus, you could use this
     command for describing `int' or `float', in which case you could
     use `data type' as the category.  (A data type is a category of
     certain objects for purposes of deciding which operations can be
     performed on them.)

     In Lisp, for example,  "pair" names a particular data type, and an
     object of that type has two slots called the CAR and the CDR.
     Here is how you would write the first line of a definition of
     `pair'.

          @deftp {Data type} pair car cdr
          ...
          @end deftp

     The template is:

          @deftp CATEGORY NAME-OF-TYPE ATTRIBUTES...
          BODY-OF-DEFINITION
          @end deftp

     `@deftp' creates an entry in the index of data types.

