home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Professional / OS2PRO194.ISO / os2 / prgramer / unix / info / texinfo.i06 (.txt) < prev    next >
GNU Info File  |  1993-06-12  |  51KB  |  1,009 lines

  1. This is Info file texinfo, produced by Makeinfo-1.47 from the input
  2. file texinfo2.tex.
  3.    This file documents Texinfo, a documentation system that uses a
  4. single source file to produce both on-line information and a printed
  5. manual.
  6.    Copyright (C) 1988, 1990, 1991, 1992 Free Software Foundation, Inc.
  7.    This is the second edition of the Texinfo documentation,
  8. and is consistent with version 2 of `texinfo.tex'.
  9.    Permission is granted to make and distribute verbatim copies of this
  10. manual provided the copyright notice and this permission notice are
  11. preserved on all copies.
  12.    Permission is granted to copy and distribute modified versions of
  13. this manual under the conditions for verbatim copying, provided that
  14. the entire resulting derived work is distributed under the terms of a
  15. permission notice identical to this one.
  16.    Permission is granted to copy and distribute translations of this
  17. manual into another language, under the above conditions for modified
  18. versions, except that this permission notice may be stated in a
  19. translation approved by the Foundation.
  20. File: texinfo,  Node: minus,  Prev: TeX and copyright,  Up: Insertions
  21. `@minus'{}: Inserting a Minus Sign
  22. ==================================
  23.    Use the `@minus{}' command to generate a minus sign.  In a
  24. fixed-width font, this is a single hyphen, but in a proportional font,
  25. the symbol is the customary length for a minus sign--a little longer
  26. than a hyphen.
  27.    You can compare the two forms:
  28.      `-' is a minus sign generated with `@minus{}',
  29.      
  30.      `-' is a hyphen generated with the character `-'.
  31. In the fixed-width font used by Info, `@minus{}' is the same as a
  32. hyphen.
  33.    You should not use `@minus{}' inside `@code' or `@example' because
  34. the width distinction is not made in the fixed-width font they use.
  35.    When you use `@minus' to specify the mark beginning each entry in an
  36. itemized list, you do not need to type the braces (*note itemize::.).
  37. File: texinfo,  Node: Glyphs,  Next: Breaks,  Prev: Insertions,  Up: Top
  38. Glyphs for Examples
  39. *******************
  40.    In Texinfo, code is often illustrated in examples that are delimited
  41. by `@example' and `@end example', or by `@lisp' and `@end lisp'.  In
  42. such examples, you can indicate the results of evaluation or an
  43. expansion using `=>' or `==>'.  Likewise, there are commands to insert
  44. glyphs to indicate printed output, error messages, equivalence of
  45. expressions, and the location of point.
  46.    The glyph-insertion commands do not need to be used within an
  47. example, but most often they are.  Every  glyph-insertion command is
  48. followed by a pair of left- and right-hand braces.
  49. * Menu:
  50. * Glyphs Summary::
  51. * result::                      How to show the result of expression.
  52. * expansion::                   How to indicate an expansion.
  53. * Print Glyph::                 How to indicate printed output.
  54. * Error Glyph::                 How to indicate an error message.
  55. * Equivalence::                 How to indicate equivalence.
  56. * Point Glyph::                 How to indicate the location of point.
  57. File: texinfo,  Node: Glyphs Summary,  Next: result,  Up: Glyphs
  58. Glyphs Summary
  59. ==============
  60.    Here are the different glyph commands:
  61.      `@result{}' points to the result of an expression.
  62.      `@expansion{}' shows the results of a macro expansion.
  63.      `@print{}' indicates printed output.
  64. error-->
  65.      `@error{}' indicates that the following text is an error message.
  66.      `@equiv{}' indicates the exact equivalence of two forms.
  67.      `@point{}' shows the location of point.
  68. File: texinfo,  Node: result,  Next: expansion,  Prev: Glyphs Summary,  Up: Glyphs
  69. =>: Indicating Evaluation
  70. =========================
  71.    Use the `@result{}' command to indicate the result of evaluating an
  72. expression.
  73.    The `@result{}' command is displayed as `=>' in Info and as a double
  74. stemmed arrow in the printed output.
  75.    Thus, the following,
  76.      (cdr '(1 2 3))
  77.           => (2 3)
  78. may be read as "`(cdr '(1 2 3))' evaluates to (2 3)".
  79. File: texinfo,  Node: expansion,  Next: Print Glyph,  Prev: result,  Up: Glyphs
  80. ==>: Indicating an Expansion
  81. ============================
  82.    When an expression is a macro call, it expands into a new expression.
  83. You can indicate the result of the expansion with the `@expansion{}'
  84. command.
  85.    The `@expansion{}' command is displayed as `==>' in Info and as a
  86. long arrow with a flat base in the printed output.
  87.    For example, the following
  88.      @lisp
  89.      (third '(a b c))
  90.           @expansion{} (car (cdr (cdr '(a b c))))
  91.           @result{} c
  92.      @end lisp
  93. produces
  94.      (third '(a b c))
  95.           ==> (car (cdr (cdr '(a b c))))
  96.           => c
  97. which may be read as:
  98.      `(third '(a b c))' expands to `(car (cdr (cdr '(a b c))))'; the
  99.      result of evaluating the expression is `c'.
  100. Often, as in this case, an example looks better if the `@expansion{}'
  101. and `@result{}' commands are indented five spaces.
  102. File: texinfo,  Node: Print Glyph,  Next: Error Glyph,  Prev: expansion,  Up: Glyphs
  103. -|: Indicating Printed Output
  104. =============================
  105.    Sometimes an expression will print output during its execution.  You
  106. can indicate the printed output with the `@print{}' command.
  107.    The `@print{}' command is displayed as `-|' in Info and similarly,
  108. as a horizontal dash butting against a vertical bar, in the printed
  109. output.
  110.    In the following example, the printed text is indicated with `-|',
  111. and the value of the expression follows on the last line.
  112.      (progn (print 'foo) (print 'bar))
  113.           -| foo
  114.           -| bar
  115.           => bar
  116. In a Texinfo source file, this example is written as follows:
  117.      @lisp
  118.      (progn (print 'foo) (print 'bar))
  119.           @print{} foo
  120.           @print{} bar
  121.           @result{} bar
  122.      @end lisp
  123. File: texinfo,  Node: Error Glyph,  Next: Equivalence,  Prev: Print Glyph,  Up: Glyphs
  124. error-->: Indicating an Error Message
  125. =====================================
  126.    A piece of code may cause an error when you evaluate it.  You can
  127. designate the error message with the `@error{}' command.
  128.    The `@error{}' command is displayed as `error-->' in Info and as the
  129. word `error' in a box in the printed output.
  130.    Thus,
  131.      @lisp
  132.      (+ 23 'x)
  133.      @error{} Wrong type argument: integer-or-marker-p, x
  134.      @end lisp
  135. produces
  136.      (+ 23 'x)
  137.      error--> Wrong type argument: integer-or-marker-p, x
  138. This indicates that the following error message is printed when you
  139. evaluate the expression:
  140.      Wrong type argument: integer-or-marker-p, x
  141.    Note that `error-->' itself is not part of the error message.
  142. File: texinfo,  Node: Equivalence,  Next: Point Glyph,  Prev: Error Glyph,  Up: Glyphs
  143. ==: Indicating Equivalence
  144. ==========================
  145.    Sometimes two expressions produce identical results.  You can
  146. indicate the exact equivalence of two forms with the `@equiv{}' command.
  147.    The `@equiv{}' command is displayed as `==' in Info and as a three
  148. parallel horizontal lines in the printed output.
  149.    Thus,
  150.      @lisp
  151.      (make-sparse-keymap) @equiv{} (list 'keymap)
  152.      @end lisp
  153. produces
  154.      (make-sparse-keymap) == (list 'keymap)
  155. This indicates that evaluating `(make-sparse-keymap)' produces
  156. identical results to evaluating `(list 'keymap)'.
  157. File: texinfo,  Node: Point Glyph,  Prev: Equivalence,  Up: Glyphs
  158. Indicating Point in a Buffer
  159. ============================
  160.    Sometimes you need to show an example of text in an Emacs buffer.  In
  161. such examples, the convention is to include the entire contents of the
  162. buffer in question between two lines of dashes containing the buffer
  163. name.
  164.    You can use the `@point{}' command to show the location of point in
  165. the text in the buffer.  (The symbol for point, of course, is not part
  166. of the text in the buffer; it indicates the place *between* two
  167. characters where point is located.)
  168.    The `@point{}' command is displayed as `-!-' in Info and as a small
  169. five pointed star in the printed output.
  170.    The following example shows the contents of buffer `foo' before and
  171. after evaluating a Lisp command to insert the word `changed'.
  172.      ---------- Buffer: foo ----------
  173.      This is the -!-contents of foo.
  174.      ---------- Buffer: foo ----------
  175.      (insert "changed ")
  176.           => nil
  177.      ---------- Buffer: foo ----------
  178.      This is the changed -!-contents of foo.
  179.      ---------- Buffer: foo ----------
  180.    In a Texinfo source file, the example is written like this:
  181.      @example
  182.      ---------- Buffer: foo ----------
  183.      This is the @point{}contents of foo.
  184.      ---------- Buffer: foo ----------
  185.      
  186.      (insert "changed ")
  187.           @result{} nil
  188.      ---------- Buffer: foo ----------
  189.      This is the changed @point{}contents of foo.
  190.      ---------- Buffer: foo ----------
  191.      @end example
  192. File: texinfo,  Node: Breaks,  Next: Definition Commands,  Prev: Glyphs,  Up: Top
  193. Making and Preventing Breaks
  194. ****************************
  195.    Usually, a Texinfo file is processed both by TeX and by one of the
  196. Info formatting commands.  Line, paragraph, or page breaks sometimes
  197. occur in the `wrong' place in one or other form of output.  You must
  198. ensure that text looks right both in the printed manual and in the Info
  199. file.
  200.    For example, in a printed manual, page breaks may occur awkwardly in
  201. the middle of an example; to prevent this, you can hold text together
  202. using a grouping command that keeps the text from being split across
  203. two pages.  Conversely, you may want to force a page break where none
  204. would occur normally.  Fortunately, problems like these do not often
  205. arise.  When they do, use the break, break prevention, or pagination
  206. commands.
  207. * Menu:
  208. * Break Commands::              Cause and prevent splits.
  209. * Line Breaks::                 How to force a single line to use two lines.
  210. * w::                           How to prevent unwanted line breaks.
  211. * sp::                          How to insert blank lines.
  212. * page::                        How to force the start of a new page.
  213. * group::                       How to prevent unwanted page breaks.
  214. * need::                        Another way to prevent unwanted page breaks.
  215. File: texinfo,  Node: Break Commands,  Next: Line Breaks,  Up: Breaks
  216. The Break Commands
  217. ==================
  218.    The break commands create line and paragraph breaks:
  219.      Force a line break.
  220. `@sp N'
  221.      Skip N blank lines.
  222.    The line-break-prevention command holds text together all on one
  223. line:
  224. `@w{TEXT}'
  225.      Prevent TEXT from being split and hyphenated across two lines.
  226.    The pagination commands apply only to printed output, since Info
  227. files do not have pages.
  228. `@page'
  229.      Start a new page in the printed manual.
  230. `@group'
  231.      Hold text together that must appear on one printed page.
  232. `@need MILS'
  233.      Start a new printed page if not enough space on this one.
  234. File: texinfo,  Node: Line Breaks,  Next: w,  Prev: Break Commands,  Up: Breaks
  235. `@*': Generate Line Breaks
  236. ==========================
  237.    The `@*' command forces a line break in both the printed manual and
  238. in Info.
  239.    For example,
  240.      This line @* is broken @*in two places.
  241. produces
  242.      This line
  243.       is broken
  244.      in two places.
  245. (Note that the space after the first `@*' command is faithfully carried
  246. down to the next line.)
  247.    The `@*' command is often used in a file's copyright page:
  248.      This is version 2.0 of the Texinfo documentation,@*
  249.      and is for ...
  250. In this case, the `@*' command keeps TeX from stretching the line
  251. across the whole page in an ugly manner.
  252.    Do not write braces after an `@*' command; they are not needed.
  253.    Do not write an `@refill' command at the end of a paragraph
  254. containing an `@*' command; it will cause the paragraph to be refilled
  255. after the line break occurs, negating the effect of the line break.
  256. File: texinfo,  Node: w,  Next: sp,  Prev: Line Breaks,  Up: Breaks
  257. `@w'{TEXT}: Prevent Line Breaks
  258. ===============================
  259.    `@w{TEXT}' outputs TEXT and prohibits line breaks within TEXT.
  260.    You can use the `@w' command to prevent TeX from automatically
  261. hyphenating a long name or phrase that accidentally falls near the end
  262. of a line.
  263.      You can copy GNU software from @w{@file{prep.ai.mit.edu}}.
  264. produces
  265.      You can copy GNU software from `prep.ai.mit.edu'.
  266.    In the Texinfo file, you must write the `@w' command and its
  267. argument (all the affected text) all on one line.
  268.    Do not write an `@refill' command at the end of a paragraph
  269. containing an `@w' command; it will cause the paragraph to be refilled
  270. and may thereby negate the effect of the `@w' command.
  271. File: texinfo,  Node: sp,  Next: page,  Prev: w,  Up: Breaks
  272. `@sp' N: Insert Blank Lines
  273. ===========================
  274.    A line beginning with and containing only `@sp N' generates N blank
  275. lines of space in both the printed manual and the Info file.  `@sp'
  276. also forces a paragraph break.  For example,
  277.      @sp 2
  278. generates two blank lines.
  279.    The `@sp' command is most often used in the title page.
  280. File: texinfo,  Node: page,  Next: group,  Prev: sp,  Up: Breaks
  281. `@page': Start a New Page
  282. =========================
  283.    A line containing only `@page' starts a new page in a printed
  284. manual.  The command has no effect on Info files since they are not
  285. paginated.  An `@page' command is often used in the `@titlepage'
  286. section of a Texinfo file to start the copyright page.
  287. File: texinfo,  Node: group,  Next: need,  Prev: page,  Up: Breaks
  288. `@group': Prevent Page Breaks
  289. =============================
  290.    The `@group' command (on a line by itself) is used inside an
  291. `@example' or similar construct to begin an unsplittable vertical
  292. group, which will appear entirely on one page in the printed output.
  293. The group is terminated by a line containing only `@end group'. These
  294. two lines produce no output of their own, and in the Info file output
  295. they have no effect at all.
  296.    Although `@group' would make sense conceptually in a wide variety of
  297. contexts, its current implementation works reliably only within
  298. `@example' and variants, and within `@display', `@format', `@flushleft'
  299. and `@flushright'.  (What all these commands have in common is that
  300. each line of input produces a line of output.) In other contexts,
  301. `@group' can cause anomalous vertical spacing. *Note Quotations and
  302. Examples::.
  303. This formatting requirement means that you should write:
  304.      @example
  305.      @group
  306.      ...
  307.      @end group
  308.      @end example
  309. with the `@group' and `@end group' command inside the `@example' and
  310. `@end example' commands.
  311.    The `@group' command is most often used to hold an example together
  312. on one page.  In this Texinfo manual, more than 100 examples contain
  313. text that is enclosed between `@group' and `@end group'.
  314.    If you forget to end a group, you may get strange and unfathomable
  315. error messages when you run TeX.  This is because TeX keeps trying to
  316. put the rest of the Texinfo file onto the one page and does not start
  317. to generate error messages until it has processed considerable text. 
  318. It is a good rule of thumb to look for a missing `@end group' if you
  319. get incomprehensible error messages in TeX.
  320. File: texinfo,  Node: need,  Prev: group,  Up: Breaks
  321. `@need MILS': Prevent Page Breaks
  322. =================================
  323.    A line containing only `@need N' starts a new page in a printed
  324. manual if fewer than N mils (thousandths of an inch) remain on the
  325. current page.  Do not use braces around the argument N.  The `@need'
  326. command has no effect on Info files since they are not paginated.
  327.    This paragraph is preceded by an `@need' command that tells TeX to
  328. start a new page if fewer than 300 mils (three-tenths inch) remain on
  329. the page.  It looks like this:
  330.      @need 300
  331.      This paragraph is preceded by ...
  332.    The `@need' command is useful for preventing orphans (single lines
  333. at the bottoms of printed pages).
  334. File: texinfo,  Node: Definition Commands,  Next: Footnotes,  Prev: Breaks,  Up: Top
  335. Definition Commands: `@deffn', etc.
  336. ***********************************
  337.    The `@deffn' command and the other "definition commands" enable you
  338. to describe functions, variables, macros, commands, user options,
  339. special forms and other such artifacts in a uniform format.
  340.    In the Info file, a definition causes the entity
  341. category--`Function', `Variable', or whatever--to appear at the
  342. beginning of the first line of the definition, followed by the entity's
  343. name and arguments.  In the printed manual, the command causes TeX to
  344. print the entity's name and its arguments on the left margin and print
  345. the category next to the right margin.  In both output formats, the
  346. body of the definition is indented.  Also, the name of the entity is
  347. entered into the appropriate index: `@deffn' enters the name into the
  348. index of functions, `@defvr' enters it into the index of variables, and
  349. so on.
  350.    A manual need not and should not contain more than one definition for
  351. a given name.  An appendix containing a summary should use `@table'
  352. rather than the definition commands.
  353. * Menu:
  354. * Def Cmd Template::            How to structure a description using a
  355.                                   definition command.
  356. * Optional Arguments::          How to handle optional and repeated arguments.
  357. * deffnx::                      How to group two or more `first' lines.
  358. * Def Cmds in Detail::          All the definition commands.
  359. * Def Cmd Conventions::         Conventions for writing definitions.
  360. * Sample Function Definition::
  361. File: texinfo,  Node: Def Cmd Template,  Next: Optional Arguments,  Up: Definition Commands
  362. The Template for a Definition
  363. =============================
  364.    The `@deffn' command is used for definitions of entities that
  365. resemble functions.  To write a definition using the `@deffn' command,
  366. write the `@deffn' command at the beginning of a line and follow it on
  367. the same line by the category of the entity, the name of the entity
  368. itself, and its arguments (if any).  Then write the body of the
  369. definition on succeeding lines.  (You may embed examples in the body.) 
  370. Finally, end the definition with an `@end deffn' command written on a
  371. line of its own.  (The other definition commands follow the same
  372. format.)
  373.    The template for a definition looks like this:
  374.      @deffn CATEGORY NAME ARGUMENTS...
  375.      BODY-OF-DEFINITION
  376.      @end deffn
  377. For example,
  378.      @deffn Command forward-word count
  379.      This command moves point forward @var{count} words
  380.      (or backward if @var{count} is negative). ...
  381.      @end deffn
  382. produces
  383.       -- Command: forward-word COUNT
  384.           This function moves point forward COUNT words (or backward if
  385.           COUNT is negative). ...
  386.    Capitalize the category name like a title.  If the name of the
  387. category contains spaces, as in the phrase `Interactive Command', write
  388. braces around it.  For example:
  389.      @deffn {Interactive Command} isearch-forward
  390.      ...
  391.      @end deffn
  392. Otherwise, the second word will be mistaken for the name of the entity.
  393.    Some of the definition commands are more general than others.  The
  394. `@deffn' command, for example, is the general definition command for
  395. functions and the like--for entities that may take arguments.  When you
  396. use this command, you specify the category to which the entity belongs.
  397.  The `@deffn' command possesses three predefined, specialized
  398. variations, `@defun', `@defmac', and `@defspec', that specify the
  399. category for you: "Function", "Macro", and "Special Form" respectively.
  400.  The `@defvr' command also is accompanied by several predefined,
  401. specialized variations for describing particular kinds of variables.
  402.    The template for a specialized definition, such as `@defun', is
  403. similar to the template for a generalized definition, except that you
  404. do not need to specify the category:
  405.      @defun NAME ARGUMENTS...
  406.      BODY-OF-DEFINITION
  407.      @end defun
  408. Thus,
  409.      @defun buffer-end flag
  410.      This function returns @code{(point-min)} if @var{flag}
  411.      is less than 1, @code{(point-max)} otherwise.
  412.      ...
  413.      @end defun
  414. produces
  415.       -- Function: buffer-end FLAG
  416.           This function returns `(point-min)' if FLAG is less than 1,
  417.           `(point-max)' otherwise.  ...
  418. *Note Sample Function Definition: Sample Function Definition, for a
  419. more detailed example of a function definition, including the use of
  420. `@example' inside the definition.
  421.    The other specialized commands work like `@defun'.
  422. File: texinfo,  Node: Optional Arguments,  Next: deffnx,  Prev: Def Cmd Template,  Up: Definition Commands
  423. Optional and Repeated Arguments
  424. ===============================
  425.    Some entities take optional or repeated arguments, which may be
  426. specified by a distinctive glyph that uses square brackets and
  427. ellipses.  For example, a special form often breaks its argument list
  428. into separate arguments in more complicated ways than a straightforward
  429. function.
  430.    An argument enclosed within square brackets is optional.  Thus,
  431. [OPTIONAL-ARG] means that OPTIONAL-ARG is optional.  An argument
  432. followed by an ellipsis is optional and may be repeated more than once.
  433.  Thus, REPEATED-ARGS... stands for zero or more arguments.  Parentheses
  434. are used when several arguments are grouped into additional levels of
  435. list structure in Lisp.
  436.    Here is the `@defspec' line of an example of an imaginary special
  437. form:
  438.       -- Special Form: foobar (VAR [FROM TO [INC]]) BODY...
  439. In this example, the arguments FROM and TO are optional, but must both
  440. be present or both absent.  If they are present, INC may optionally be
  441. specified as well.  These arguments are grouped with the argument VAR
  442. into a list, to distinguish them from BODY, which includes all
  443. remaining elements of the form.
  444.    In a Texinfo source file, this `@defspec' line is written like this
  445. (except it would not be split over two lines, as it is in this example).
  446.      @defspec foobar (@var{var} [@var{from} @var{to}
  447.           [@var{inc}]]) @var{body}@dots{}
  448. The function is listed in the Command and Variable Index under `foobar'.
  449. File: texinfo,  Node: deffnx,  Next: Def Cmds in Detail,  Prev: Optional Arguments,  Up: Definition Commands
  450. Two or More `First' Lines
  451. =========================
  452.    To create two or more `first' or header lines for a definition,
  453. follow the first `@deffn' line by a line beginning with `@deffnx'. The
  454. `@deffnx' command works exactly like `@deffn' except that it does not
  455. generate extra vertical white space between it and the preceding line.
  456.    For example,
  457.      @deffn {Interactive Command} isearch-forward
  458.      @deffnx {Interactive Command} isearch-backward
  459.      These two search commands are similar except ...
  460.      @end deffn
  461. produces
  462.  -- Interactive Command: isearch-forward
  463.  -- Interactive Command: isearch-backward
  464.      These two search commands are similar except ...
  465.    Each of the other definition commands has an `x' form: `@defunx',
  466. `@defvrx', `@deftypefunx', etc.
  467.    The `x' forms work just like `@itemx'; see *Note `@itemx': itemx.
  468. File: texinfo,  Node: Def Cmds in Detail,  Next: Def Cmd Conventions,  Prev: deffnx,  Up: Definition Commands
  469. The Definition Commands
  470. =======================
  471.    Texinfo provides more than a dozen definition commands, all of which
  472. are described in this section.
  473.    The definition commands automatically enter the name of the entity in
  474. the appropriate index: for example, `@deffn', `@defun', and `@defmac'
  475. enter function names in the index of functions; `@defvr' and `@defvar'
  476. enter variable names in the index of variables.
  477.    Although the examples that follow mostly illustrate Lisp, the
  478. commands can be used for other programming languages.
  479. * Menu:
  480. * Functions Commands::          Commands for functions and similar entities.
  481. * Variables Commands::          Commands for variables and similar entities.
  482. * Typed Functions::             Commands for functions in typed languages.
  483. * Typed Variables::             Commands for variables in typed languages.
  484. * Abstract Objects::            Commands for object-oriented programming.
  485. * Data Types::                  The definition command for data types.
  486. File: texinfo,  Node: Functions Commands,  Next: Variables Commands,  Up: Def Cmds in Detail
  487. Functions and Similar Entities
  488. ------------------------------
  489.    This section describes the commands for describing functions and
  490. similar entities:
  491. `@deffn CATEGORY NAME ARGUMENTS...'
  492.      The `@deffn' command is the general definition command for
  493.      functions, interactive commands, and similar entities that may take
  494.      arguments.  You must choose a term to describe the category of
  495.      entity being defined; for example, "Function" could be used if the
  496.      entity is a function.  The `@deffn' command is written at the
  497.      beginning of a line and is followed on the same line by the
  498.      category of entity being described, the name of this particular
  499.      entity, and its arguments, if any.  Terminate the definition with
  500.      `@end deffn' on a line of its own.
  501.      For example, here is a definition:
  502.           @deffn Command forward-char nchars
  503.           Move point forward @var{nchars} characters.
  504.           @end deffn
  505.      This shows a rather terse definition for a "command" named
  506.      `forward-char' with one argument, NCHARS.
  507.      `@deffn' prints argument names such as NCHARS in italics or upper
  508.      case, as if `@var' had been used, because we think of these names
  509.      as metasyntactic variables--they stand for the actual argument
  510.      values.  Within the text of the description, write an argument name
  511.      explicitly with `@var' to refer to the value of the argument.  In
  512.      the example above, we used `@var{nchars}' in this way.
  513.      The template for `@deffn' is:
  514.           @deffn CATEGORY NAME ARGUMENTS...
  515.           BODY-OF-DEFINITION
  516.           @end deffn
  517. `@defun NAME ARGUMENTS...'
  518.      The `@defun' command is the definition command for functions.
  519.      `@defun' is equivalent to `@deffn Function ...'.
  520.      For example,
  521.           @defun set symbol new-value
  522.           Change the value of the symbol @var{symbol}
  523.           to @var{new-value}.
  524.           @end defun
  525.      shows a rather terse definition for a function `set' whose
  526.      arguments are SYMBOL and NEW-VALUE.  The argument names on the
  527.      `@defun' line automatically appear in italics or upper case as if
  528.      they were enclosed in `@var'.  Terminate the definition with `@end
  529.      defun' on a line of its own.
  530.      The template is:
  531.           @defun FUNCTION-NAME ARGUMENTS...
  532.           BODY-OF-DEFINITION
  533.           @end defun
  534.      `@defun' creates an entry in the index of functions.
  535. `@defmac NAME ARGUMENTS...'
  536.      The `@defmac' command is the definition command for macros.
  537.      `@defmac' is equivalent to `@deffn Macro ...' and works like
  538.      `@defun'.
  539. `@defspec NAME ARGUMENTS...'
  540.      The `@defspec' command is the definition command for special
  541.      forms.  (In Lisp, a special form is an entity much like a
  542.      function.) `@defspec' is equivalent to `@deffn {Special Form} ...'
  543.      and works like `@defun'.
  544. File: texinfo,  Node: Variables Commands,  Next: Typed Functions,  Prev: Functions Commands,  Up: Def Cmds in Detail
  545. Variables and Similar Entities
  546. ------------------------------
  547.    Here are the commands for defining variables and similar entities:
  548. `@defvr CATEGORY NAME'
  549.      The `@defvr' command is a general definition command for something
  550.      like a variable--an entity that records a value.  You must choose
  551.      a term to describe the category of entity being defined; for
  552.      example, "Variable" could be used if the entity is a variable.
  553.      Write the `@defvr' command at the beginning of a line and followed
  554.      it on the same line by the category of the entity and the name of
  555.      the entity.
  556.      Capitalize the category name like a title.  If the name of the
  557.      category contains spaces, as in the name `User Option', write
  558.      braces around it.  Otherwise, the second word will be mistaken for
  559.      the name of the entity.
  560.      For example:
  561.           @defvr {User Option} fill-column
  562.           This buffer-local variable specifies
  563.           the maximum width of filled lines.
  564.           ...
  565.           @end defvr
  566.      Terminate the definition with `@end defvr' on a line of its own.
  567.      The template is:
  568.           @defvr CATEGORY NAME
  569.           BODY-OF-DEFINITION
  570.           @end defvr
  571.      `@defvr' creates an entry in the index of variables for NAME.
  572. `@defvar NAME'
  573.      The `@defvar' command is the definition command for variables.
  574.      `@defvar' is equivalent to `@defvr Variable ...'.
  575.      For example:
  576.           @defvar kill-ring
  577.           ...
  578.           @end defvar
  579.      The template is:
  580.           @defvar NAME
  581.           BODY-OF-DEFINITION
  582.           @end defvar
  583.      `@defvar' creates an entry in the index of variables for NAME.
  584. `@defopt NAME'
  585.      The `@defopt' command is the definition command for user options. 
  586.      `@defopt' is equivalent to `@defvr {User Option} ...' and works
  587.      like `@defvar'.
  588. File: texinfo,  Node: Typed Functions,  Next: Typed Variables,  Prev: Variables Commands,  Up: Def Cmds in Detail
  589. Functions in Typed Languages
  590. ----------------------------
  591.    The `@deftypefn' command and its variations are for describing
  592. functions in C or any other language in which you must declare types of
  593. variables and functions.
  594. `@deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS...'
  595.      The `@deftypefn' command is the general definition command for
  596.      functions and similar entities that may take arguments and that are
  597.      typed.  The `@deftypefn' command is written at the beginning of a
  598.      line and is followed on the same line by the category of entity
  599.      being described, the type of the returned value, the name of this
  600.      particular entity, and its arguments, if any.
  601.      For example,
  602.           @deftypefn {Library Function} int foobar
  603.              (int @var{foo}, float @var{bar})
  604.           ...
  605.           @end deftypefn
  606.      (where the text before the "...", shown above as two lines, would
  607.      actually be a single line in a real Texinfo file) produces the
  608.      following in Info:
  609.           -- Library Function: int foobar (int FOO, float BAR)
  610.           ...
  611.      This means that `foobar' is a "library function" that returns an
  612.      `int', and its arguments are FOO (an `int') and BAR (a `float').
  613.      The argument names that you write in `@deftypefn' are not subject
  614.      to an implicit `@var'--since the actual names of the arguments in
  615.      `@deftypefn' are typically scattered among data type names and
  616.      keywords, Texinfo cannot find them without help.  Instead, you
  617.      must write `@var' explicitly around the argument names.  In the
  618.      example above, the argument names are `foo' and `bar'.
  619.      The template for `@deftypefn' is:
  620.           @deftypefn CATEGORY DATA-TYPE NAME ARGUMENTS ...
  621.           BODY-OF-DESCRIPTION
  622.           @end deftypefn
  623.      Note that if the CATEGORY or DATA TYPE is more than one word then
  624.      it must be enclosed in braces to make it a single argument.
  625.      If you are describing a procedure in a language that has packages,
  626.      such as Ada, you might consider using `@deftypefn' in a manner
  627.      somewhat contrary to the convention described in the preceding
  628.      paragraphs.
  629.      For example:
  630.           @deftypefn stacks private push
  631.                   (@var{s}:in out stack;
  632.                   @var{n}:in integer)
  633.           ...
  634.           @end deftypefn
  635.      (The `@deftypefn' arguments are shown split into three lines, but
  636.      would be a single line in a real Texinfo file.)
  637.      In this instance, the procedure is classified as belonging to the
  638.      package `stacks' rather than classified as a `procedure' and its
  639.      data type is described as `private'.  (The name of the procedure
  640.      is `push', and its arguments are S and N.)
  641.      `@deftypefn' creates an entry in the index of functions for NAME.
  642. `@deftypefun DATA-TYPE NAME ARGUMENTS...'
  643.      The `@deftypefun' command is the specialized definition command
  644.      for functions in typed languages.  The command is equivalent to
  645.      `@deftypefn Function ...'.
  646.           @deftypefun int foobar (int @var{foo}, float @var{bar})
  647.           ...
  648.           @end deftypefun
  649.      produces the following in Info:
  650.           -- Function: int foobar (int FOO, float BAR)
  651.           ...
  652.      The template is:
  653.           @deftypefun TYPE NAME ARGUMENTS...
  654.           BODY-OF-DESCRIPTION
  655.           @end deftypefun
  656.      `@deftypefun' creates an entry in the index of functions for NAME.
  657. File: texinfo,  Node: Typed Variables,  Next: Abstract Objects,  Prev: Typed Functions,  Up: Def Cmds in Detail
  658. Variables in Typed Languages
  659. ----------------------------
  660.    Variables in typed languages are handled in a manner similar to
  661. functions in typed languages.  *Note Typed Functions::.  The general
  662. definition command `@deftypevr' corresponds to `@deftypefn' and the
  663. specialized definition command `@deftypevar' corresponds to
  664. `@deftypefun'.
  665. `@deftypevr CATEGORY DATA-TYPE NAME'
  666.      The `@deftypevr' command is the general definition command for
  667.      something like a variable in a typed language--an entity that
  668.      records a value.  You must choose a term to describe the category
  669.      of the entity being defined; for example, "Variable" could be used
  670.      if the entity is a variable.
  671.      The `@deftypevr' command is written at the beginning of a line and
  672.      is followed on the same line by the category of the entity being
  673.      described, the data type, and the name of this particular entity.
  674.      For example,
  675.           @deftypevr {Global Flag} int enable
  676.           ...
  677.           @end deftypevr
  678.      produces the following in Info:
  679.           -- Global Flag: int enable
  680.           ...
  681.      The template is:
  682.           @deftypevr CATEGORY DATA-TYPE NAME
  683.           BODY-OF-DESCRIPTION
  684.           @end deftypevr
  685.      `@deftypevr' creates an entry in the index of variables for NAME.
  686. `@deftypevar DATA-TYPE NAME'
  687.      The `@deftypevar' command is the specialized definition command
  688.      for variables in typed languages.  `@deftypevar' is equivalent to
  689.      `@deftypevr Variable ...'.
  690.      For example,
  691.           @deftypevar int fubar
  692.           ...
  693.           @end deftypevar
  694.      produces the following in Info:
  695.           -- Variable: int fubar
  696.           ...
  697.      The template is:
  698.           @deftypevar DATA-TYPE NAME
  699.           BODY-OF-DESCRIPTION
  700.           @end deftypevar
  701.      `@deftypevar' creates an entry in the index of variables for NAME.
  702. File: texinfo,  Node: Abstract Objects,  Next: Data Types,  Prev: Typed Variables,  Up: Def Cmds in Detail
  703. Object-Oriented Programming
  704. ---------------------------
  705.    Here are the commands for formatting descriptions about abstract
  706. objects, such as are used in object-oriented programming.  A class is a
  707. defined type of abstract object.  An instance of a class is a
  708. particular object that has the type of the class.  An instance variable
  709. is a variable that belongs to the class but for which each instance has
  710. its own value.
  711.    In a definition, if the name of a class is truly a name defined in
  712. the programming system for a class, then you should write an `@code'
  713. around it.  Otherwise, it is printed in the usual text font.
  714. `@defcv CATEGORY CLASS NAME'
  715.      The `@defcv' command is the general definition command for
  716.      variables associated with classes in object-oriented programming. 
  717.      The `@defcv' command is followed by three arguments: the category
  718.      of thing being defined, the class to which it belongs, and its
  719.      name.
  720.      Thus,
  721.           @defcv {Class Option} Window border-pattern
  722.           ...
  723.           @end defcv
  724.      illustrates how you would write the first line of a definition of
  725.      the `border-pattern' class option of the class `Window'.
  726.      The template is
  727.           @defcv CATEGORY CLASS NAME
  728.           ...
  729.           @end defcv
  730.      `@defcv' creates an entry in the index of variables.
  731. `@defivar CLASS NAME'
  732.      The `@defivar' command is the definition command for instance
  733.      variables in object-oriented programming.  `@defivar' is
  734.      equivalent to `@defcv {Instance Variable} ...'
  735.      The template is:
  736.           @defivar CLASS INSTANCE-VARIABLE-NAME
  737.           BODY-OF-DEFINITION
  738.           @end defivar
  739.      `@defivar' creates an entry in the index of variables.
  740. `@defop CATEGORY CLASS NAME ARGUMENTS...'
  741.      The `@defop' command is the general definition command for
  742.      entities that may resemble methods in object-oriented programming.
  743.      These entities take arguments, as functions do, but are associated
  744.      with particular classes of objects.
  745.      For example, some systems have constructs called "wrappers" that
  746.      are associated with classes as methods are, but that act more like
  747.      macros than like functions.  You could use `@defop Wrapper' to
  748.      describe one of these.
  749.      Sometimes it is useful to distinguish methods and "operations".
  750.      You can think of an operation as the specification for a method.
  751.      Thus, a window system might specify that all window classes have a
  752.      method named `expose'; we would say that this window system
  753.      defines an `expose' operation on windows in general.  Typically,
  754.      the operation has a name and also specifies the pattern of
  755.      arguments; all methods that implement the operation must accept
  756.      the same arguments, since applications that use the operation do
  757.      so without knowing which method will implement it.
  758.      Often it makes more sense to document operations than methods.  For
  759.      example, window application developers need to know about the
  760.      `expose' operation, but need not be concerned with whether a given
  761.      class of windows has its own method to implement this operation.
  762.      To describe this operation, you would write:
  763.           @defop Operation windows expose
  764.      The `@defop' command is written at the beginning of a line and is
  765.      followed on the same line by the overall name of the category of
  766.      operation, the name of the class of the operation, the name of the
  767.      operation, and its arguments, if any.
  768.      The template is:
  769.           @defop CATEGORY CLASS NAME ARGUMENTS...
  770.           BODY-OF-DEFINITION
  771.           @end defop
  772.      `@defop' creates an entry, such as ``expose' on `windows'', in the
  773.      index of functions.
  774. `@defmethod CLASS NAME ARGUMENTS...'
  775.      The `@defmethod' command is the definition command for methods in
  776.      object-oriented programming.  A method is a kind of function that
  777.      implements an operation for a particular class of objects and its
  778.      subclasses.  In the Lisp Machine, methods actually were functions,
  779.      but they were usually defined with `defmethod'.
  780.      `@defmethod' is equivalent to `@defop Method ...'. The command is
  781.      written at the beginning of a line and is followed by the name of
  782.      the class of the method, the name of the method, and its
  783.      arguments, if any.
  784.      For example,
  785.           @defmethod `bar-class' bar-method argument
  786.           ...
  787.           @end defmethod
  788.      illustrates the definition for a method called `bar-method' of the
  789.      class `bar-class'.  The method takes an argument.
  790.      The template is:
  791.           @defmethod CLASS METHOD-NAME ARGUMENTS...
  792.           BODY-OF-DEFINITION
  793.           @end defmethod
  794.      `@defmethod' creates an entry, such as ``bar-method' on
  795.      `bar-class'', in the index of functions.
  796. File: texinfo,  Node: Data Types,  Prev: Abstract Objects,  Up: Def Cmds in Detail
  797. Data Types
  798. ----------
  799.    Here is the command for data types:
  800. `@deftp CATEGORY NAME ATTRIBUTES...'
  801.      The `@deftp' command is the generic definition command for data
  802.      types.  The command is written at the beginning of a line and is
  803.      followed on the same line by the category, by the name of the type
  804.      (which is a word like `int' or `float'), and then by names of
  805.      attributes of objects of that type.  Thus, you could use this
  806.      command for describing `int' or `float', in which case you could
  807.      use `data type' as the category.  (A data type is a category of
  808.      certain objects for purposes of deciding which operations can be
  809.      performed on them.)
  810.      In Lisp, for example,  "pair" names a particular data type, and an
  811.      object of that type has two slots called the CAR and the CDR. 
  812.      Here is how you would write the first line of a definition of
  813.      `pair'.
  814.           @deftp {Data type} pair car cdr
  815.           ...
  816.           @end deftp
  817.      The template is:
  818.           @deftp CATEGORY NAME-OF-TYPE ATTRIBUTES...
  819.           BODY-OF-DEFINITION
  820.           @end deftp
  821.      `@deftp' creates an entry in the index of data types.
  822. File: texinfo,  Node: Def Cmd Conventions,  Next: Sample Function Definition,  Prev: Def Cmds in Detail,  Up: Definition Commands
  823. Conventions for Writing Definitions
  824. ===================================
  825.    When you write a definition using `@deffn', `@defun', or one of the
  826. other definition commands, please take care to use arguments that
  827. indicate the meaning, as with the COUNT argument to the `forward-word'
  828. function.  Also, if the name of an argument contains the name of a
  829. type, such as INTEGER, take care that the argument actually is of that
  830. type.
  831. File: texinfo,  Node: Sample Function Definition,  Prev: Def Cmd Conventions,  Up: Definition Commands
  832. A Sample Function Definition
  833. ============================
  834.    A function definition uses the `@defun' and `@end defun' commands. 
  835. The name of the function follows immediately after the `@defun' command
  836. and it is followed, on the same line, by the parameter list.
  837.    Here is a definition from `The GNU Emacs Lisp Reference Manual'.
  838. (*Note Calling Functions: (elisp)Calling Functions.)
  839.       -- Function: apply FUNCTION &rest ARGUMENTS
  840.           `apply' calls FUNCTION with ARGUMENTS, just like `funcall'
  841.           but with one difference: the last of ARGUMENTS is a list of
  842.           arguments to give to FUNCTION, rather than a single argument.
  843.            We also say that this list is "appended" to the other
  844.           arguments.
  845.           `apply' returns the result of calling FUNCTION. As with
  846.           `funcall', FUNCTION must either be a Lisp function or a
  847.           primitive function; special forms and macros do not make
  848.           sense in `apply'.
  849.                (setq f 'list)
  850.                     => list
  851.                (apply f 'x 'y 'z)
  852.                error--> Wrong type argument: listp, z
  853.                (apply '+ 1 2 '(3 4))
  854.                     => 10
  855.                (apply '+ '(1 2 3 4))
  856.                     => 10
  857.                
  858.                (apply 'append '((a b c) nil (x y z) nil))
  859.                     => (a b c x y z)
  860.           An interesting example of using `apply' is found in the
  861.           description of `mapcar'.
  862.    In the Texinfo source file, this example looks like this:
  863.      @defun apply function &rest arguments
  864.      
  865.      @code{apply} calls @var{function} with
  866.      @var{arguments}, just like @code{funcall} but with one
  867.      difference: the last of @var{arguments} is a list of
  868.      arguments to give to @var{function}, rather than a single
  869.      argument.  We also say that this list is @dfn{appended}
  870.      to the other arguments.
  871.      
  872.      @code{apply} returns the result of calling
  873.      @var{function}.  As with @code{funcall},
  874.      @var{function} must either be a Lisp function or a
  875.      primitive function; special forms and macros do not make
  876.      sense in @code{apply}.
  877.      
  878.      @example
  879.      (setq f 'list)
  880.           @result{} list
  881.      (apply f 'x 'y 'z)
  882.      @error{} Wrong type argument: listp, z
  883.      (apply '+ 1 2 '(3 4))
  884.           @result{} 10
  885.      (apply '+ '(1 2 3 4))
  886.           @result{} 10
  887.      
  888.      (apply 'append '((a b c) nil (x y z) nil))
  889.           @result{} (a b c x y z)
  890.      @end example
  891.      
  892.      An interesting example of using @code{apply} is found in the description
  893.      of @code{mapcar}.@refill
  894.      @end defun
  895. In this manual, this function is listed in the Command and Variable
  896. Index under `apply'.
  897.    Ordinary variables and user options are described using a format like
  898. that for functions except that variables do not take arguments.
  899. File: texinfo,  Node: Footnotes,  Next: Conditionals,  Prev: Definition Commands,  Up: Top
  900. Footnotes
  901. *********
  902.    A "footnote" is for a reference that documents or elucidates the
  903. primary text.(1)
  904.    In Texinfo, footnotes are created with the `@footnote' command. This
  905. command is followed immediately by a left brace, then by the text of
  906. the footnote, and then by a terminating right brace.  The template is:
  907.      @footnote{TEXT}
  908.    Footnotes may be of any length, but are usually short.
  909.    For example, this clause is followed by a sample footnote(2); in the
  910. Texinfo source, it looks like this:
  911.      ...a sample footnote @footnote{Here is the sample
  912.      footnote.}; in the Texinfo source...
  913.    In a printed manual or book, the reference mark for a footnote is a
  914. small, superscripted number; the text of the footnote is written at the
  915. bottom of the page, below a horizontal line.
  916.    In Info, the reference mark for a footnote is a pair of parentheses
  917. with the footnote number between them, like this: `(1)'.
  918.    Info has two footnote styles, which determine where the text of the
  919. footnote is located:
  920.    * In the `End' node style, all the footnotes for a single node are
  921.      placed at the end of that node.  The footnotes are separated from
  922.      the rest of the node by a line of dashes with the word `Footnotes'
  923.      within it.  Each footnote begins with an `(N)' reference mark.
  924.      Here is an example of a single footnote in the end of node style:
  925.            --------- Footnotes ---------
  926.           
  927.           (1)  Here is a sample footnote.
  928.    * In the `Separate' node style, all the footnotes for a single node
  929.      are placed in an automatically constructed node of their own.  In
  930.      this style, a "footnote reference" follows each `(N)' reference
  931.      mark in the body of the node.  The footnote reference is actually
  932.      a cross reference which you use to reach the footnote node.
  933.      The name of the node containing the footnotes is constructed by
  934.      appending `-Footnotes' to the name of the node that contains the
  935.      footnotes. (Consequently, the footnotes' node for the `Footnotes'
  936.      node is `Footnotes-Footnotes'!)  The footnotes' node has an `Up'
  937.      node pointer that leads back to its parent node.
  938. Here is how the first footnote in this manual looks after being
  939. formatted for Info in the separate node style:
  940.      File: texinfo.info  Node: Overview-Footnotes, Up: Overview
  941.      
  942.      (1) Note that the first syllable of "Texinfo" is
  943.      pronounced like "speck", not "hex". ...
  944.    A Texinfo file may be formatted into an Info file with either
  945. footnote style.
  946.    Use the `@footnotestyle' command to specify an Info file's footnote
  947. style.  Write this command at the beginning of a line followed by an
  948. argument, either `end' for the end node style or `separate' for the
  949. separate node style.
  950.    For example:
  951.      @footnotestyle end
  952.      @footnotestyle separate
  953.    Write an `@footnotestyle' command before or shortly after the
  954. end-of-header line at the beginning of a Texinfo file.  (If you include
  955. the `@footnotestyle' command between the start-of-header and
  956. end-of-header lines, the region formatting commands will format
  957. footnotes as specified.)
  958.    If you do not specify a footnote style, the formatting commands use
  959. their default style.  Currently, `texinfo-format-buffer' and
  960. `texinfo-format-region' use the `separate' style and `makeinfo' uses
  961. the `end' style.
  962.    This chapter contains two footnotes.
  963.    ---------- Footnotes ----------
  964.    (1)  A footnote should complement or expand upon the primary text,
  965. but a reader should not need to read a footnote to understand the
  966. primary text.  For a thorough discussion of footnotes, see `The Chicago
  967. Manual of Style', which is published by the University of Chicago Press.
  968.    (2)  Here is the sample footnote.
  969. File: texinfo,  Node: Conditionals,  Next: Format/Print Hardcopy,  Prev: Footnotes,  Up: Top
  970. Conditionally Visible Text
  971. **************************
  972.    Sometimes it is good to use different text for a printed manual and
  973. its corresponding Info file.  In this case, you can use the
  974. "conditional commands" to specify which text is for the printed manual
  975. and which is for the Info file.
  976. * Menu:
  977. * Conditional Commands::        Specifying text for Info or TeX.
  978. * Using Ordinary TeX Commands::  You can use any and all TeX commands.
  979. * set and clear::               Designating which text to format (for both
  980.                                   Info and TeX).
  981. File: texinfo,  Node: Conditional Commands,  Next: Using Ordinary TeX Commands,  Up: Conditionals
  982. Using `@ifinfo' and `@iftex'
  983. ============================
  984.    `@ifinfo' begins segments of text that should be ignored by TeX when
  985. it typesets the printed manual.  The segment of text appears only in
  986. the Info file. The `@ifinfo' command should appear on a line by itself;
  987.  end the Info-only text with a line containing `@end ifinfo' by itself.
  988.  At the beginning of a Texinfo file, the Info permissions are contained
  989. within a region marked by `@ifinfo' and `@end ifinfo'. (*Note Info
  990. Summary and Permissions::.)
  991.    The `@iftex' and `@end iftex' commands are similar to the `@ifinfo'
  992. and `@end ifinfo' commands, except that they specify text that will
  993. appear in the printed manual but not in the Info file.
  994.    For example:
  995.      @iftex
  996.      This text will appear only in the printed manual.
  997.      @end iftex
  998.      
  999.      @ifinfo
  1000.      However, this text will appear only in Info.
  1001.      @end ifinfo
  1002. The preceding example produces the following line:
  1003.    However, this text will appear only in Info.
  1004. Note how you only see one of the two lines, depending on whether you
  1005. are reading the Info version or the printed version of this manual.
  1006.    The `@titlepage' command is a special variant of `@iftex' that is
  1007. used for making the title and copyright pages of the printed manual.
  1008. (*Note `@titlepage': titlepage.)
  1009.