XEmacs 21.2.22 "Mercedes".
[chise/xemacs-chise.git.1] / man / info.texi
1 \input texinfo    @c -*-texinfo-*-
2 @comment %**start of header
3 @setfilename ../info/info.info
4 @settitle Info
5 @comment %**end of header
6 @comment $Id: info.texi,v 1.11 1999/04/19 21:37:23 karl Exp $
7
8 @dircategory Texinfo documentation system
9 @direntry
10 * Info: (info).                 Documentation browsing system.
11 @end direntry
12
13 @ifinfo
14 This file describes how to use Info, the on-line, menu-driven GNU
15 documentation system.
16
17 Copyright (C) 1989, 92, 96, 97, 98, 99 Free Software Foundation, Inc.
18
19 Permission is granted to make and distribute verbatim copies of
20 this manual provided the copyright notice and this permission notice
21 are preserved on all copies.
22
23 @ignore
24 Permission is granted to process this file through TeX and print the
25 results, provided the printed document carries copying permission
26 notice identical to this one except for the removal of this paragraph
27 (this paragraph not being relevant to the printed manual).
28
29 @end ignore
30 Permission is granted to copy and distribute modified versions of this
31 manual under the conditions for verbatim copying, provided that the entire
32 resulting derived work is distributed under the terms of a permission
33 notice identical to this one.
34
35 Permission is granted to copy and distribute translations of this manual
36 into another language, under the above conditions for modified versions,
37 except that this permission notice may be stated in a translation approved
38 by the Free Software Foundation.
39 @end ifinfo
40
41 @titlepage
42 @title Info
43 @subtitle The online, menu-driven GNU documentation system
44 @author Brian Fox
45 @page
46 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99 Free Software
48 Foundation, Inc.
49 @sp 2
50 Published by the Free Software Foundation @*
51 59 Temple Place - Suite 330 @*
52 Boston, MA 02111-1307, USA.
53
54 Permission is granted to make and distribute verbatim copies of
55 this manual provided the copyright notice and this permission notice
56 are preserved on all copies.
57
58 Permission is granted to copy and distribute modified versions of this
59 manual under the conditions for verbatim copying, provided that the entire
60 resulting derived work is distributed under the terms of a permission
61 notice identical to this one.
62
63 Permission is granted to copy and distribute translations of this manual
64 into another language, under the above conditions for modified versions,
65 except that this permission notice may be stated in a translation approved
66 by the Free Software Foundation.
67 @end titlepage
68
69 @ifnottex
70 @node Top
71 @top Info: An Introduction
72
73 Info is a program for reading documentation, which you are using now.
74
75 To learn how to use Info, type the command @kbd{h}.  It brings you
76 to a programmed instruction sequence.
77 @end ifnottex
78
79 @menu
80 * Getting Started::             Getting started using an Info reader.
81 * Advanced Info::               Advanced commands within Info.
82 * Creating an Info File::       How to make your own Info file.
83 @end menu
84
85 @node Getting Started, Advanced Info, Top, Top
86 @comment  node-name,  next,  previous,  up
87 @chapter Getting Started
88
89 This first part of the Info manual describes how to get around inside
90 of Info.  The second part of the manual describes various advanced
91 Info commands, and how to write an Info as distinct from a Texinfo
92 file.  The third part is about how to generate Info files from
93 Texinfo files.
94
95 @iftex
96 This manual is primarily designed for use on a computer, so that you can
97 try Info commands while reading about them.  Reading it on paper is less
98 effective, since you must take it on faith that the commands described
99 really do what the manual says.  By all means go through this manual now
100 that you have it; but please try going through the on-line version as
101 well.
102
103 There are two ways of looking at the online version of this manual:
104
105 @enumerate
106 @item
107 Type @code{info} at your shell's command line.  This approach uses a
108 small stand-alone program designed just to read Info files.
109
110 @item
111 Type @code{emacs} at the command line; then type @kbd{C-h i} (Control
112 @kbd{h}, followed by @kbd{i}).  This approach uses the Info mode of the
113 Emacs program, an editor with many other capabilities.
114 @end enumerate
115
116 In either case, then type @kbd{mInfo} (just the letters), followed by
117 @key{RET}---the ``Return'' or ``Enter'' key.  At this point, you should
118 be ready to follow the instructions in this manual as you read them on
119 the screen.
120 @c FIXME! (pesch@cygnus.com, 14 dec 1992)
121 @c Is it worth worrying about what-if the beginner goes to somebody
122 @c else's Emacs session, which already has an Info running in the middle
123 @c of something---in which case these simple instructions won't work?
124 @end iftex
125
126 @menu
127 * Help-Small-Screen::   Starting Info on a Small Screen
128 * Help::                How to use Info
129 * Help-P::              Returning to the Previous node
130 * Help-^L::             The Space, Rubout, B and ^L commands.
131 * Help-M::              Menus
132 * Help-Adv::            Some advanced Info commands
133 * Help-Q::              Quitting Info
134 @end menu
135
136 @node Help-Small-Screen, Help,  , Getting Started
137 @comment  node-name,  next,  previous,  up
138 @section Starting Info on a Small Screen
139
140 @iftex
141 (In Info, you only see this section if your terminal has a small
142 number of lines; most readers pass by it without seeing it.)
143 @end iftex
144
145 Since your terminal has an unusually small number of lines on its
146 screen, it is necessary to give you special advice at the beginning.
147
148 If you see the text @samp{--All----} at near the bottom right corner
149 of the screen, it means the entire text you are looking at fits on the
150 screen.  If you see @samp{--Top----} instead, it means that there is
151 more text below that does not fit.  To move forward through the text
152 and see another screen full, press the Space bar, @key{SPC}.  To move
153 back up, press the key labeled @samp{Backspace} or @key{Delete}.
154
155 @ifinfo
156 Here are 40 lines of junk, so you can try Spaces and Deletes and
157 see what they do.  At the end are instructions of what you should do
158 next.
159
160 This is line 17 @*
161 This is line 18 @*
162 This is line 19 @*
163 This is line 20 @*
164 This is line 21 @*
165 This is line 22 @*
166 This is line 23 @*
167 This is line 24 @*
168 This is line 25 @*
169 This is line 26 @*
170 This is line 27 @*
171 This is line 28 @*
172 This is line 29 @*
173 This is line 30 @*
174 This is line 31 @*
175 This is line 32 @*
176 This is line 33 @*
177 This is line 34 @*
178 This is line 35 @*
179 This is line 36 @*
180 This is line 37 @*
181 This is line 38 @*
182 This is line 39 @*
183 This is line 40 @*
184 This is line 41 @*
185 This is line 42 @*
186 This is line 43 @*
187 This is line 44 @*
188 This is line 45 @*
189 This is line 46 @*
190 This is line 47 @*
191 This is line 48 @*
192 This is line 49 @*
193 This is line 50 @*
194 This is line 51 @*
195 This is line 52 @*
196 This is line 53 @*
197 This is line 54 @*
198 This is line 55 @*
199 This is line 56 @*
200
201 If you have managed to get here, go back to the beginning with
202 Delete, and come back here again, then you understand Space and
203 Delete.  So now type an @kbd{n} ---just one character; don't type
204 the quotes and don't type the Return key afterward--- to
205 get to the normal start of the course.
206 @end ifinfo
207
208 @node Help, Help-P, Help-Small-Screen, Getting Started
209 @comment  node-name,  next,  previous,  up
210 @section How to use Info
211
212 You are talking to the program Info, for reading documentation.
213
214   Right now you are looking at one @dfn{Node} of Information.
215 A node contains text describing a specific topic at a specific
216 level of detail.  This node's topic is ``how to use Info''.
217
218   The top line of a node is its @dfn{header}.  This node's header (look at
219 it now) says that it is the node named @samp{Help} in the file
220 @file{info}.  It says that the @samp{Next} node after this one is the node
221 called @samp{Help-P}.  An advanced Info command lets you go to any node
222 whose name you know.
223
224   Besides a @samp{Next}, a node can have a @samp{Previous} or an @samp{Up}.
225 This node has a @samp{Previous} but no @samp{Up}, as you can see.
226
227   Now it is time to move on to the @samp{Next} node, named @samp{Help-P}.
228
229 >> Type @samp{n} to move there.  Type just one character;
230    do not type the quotes and do not type a @key{RET} afterward.
231
232 @samp{>>} in the margin means it is really time to try a command.
233
234 @node Help-P, Help-^L, Help, Getting Started
235 @comment  node-name,  next,  previous,  up
236 @section Returning to the Previous node
237
238 This node is called @samp{Help-P}.  The @samp{Previous} node, as you see,
239 is @samp{Help}, which is the one you just came from using the @kbd{n}
240 command.  Another @kbd{n} command now would take you to the next
241 node, @samp{Help-^L}.
242
243 >> But do not do that yet.  First, try the @kbd{p} command, which takes
244    you to the @samp{Previous} node.  When you get there, you can do an
245    @kbd{n} again to return here.
246
247   This all probably seems insultingly simple so far, but @emph{do not} be
248 led into skimming.  Things will get more complicated soon.  Also,
249 do not try a new command until you are told it is time to.  Otherwise,
250 you may make Info skip past an important warning that was coming up.
251
252 >> Now do an @kbd{n} to get to the node @samp{Help-^L} and learn more.
253
254 @node Help-^L, Help-M, Help-P, Getting Started
255 @comment  node-name,  next,  previous,  up
256 @section The Space, Delete, B and ^L commands.
257
258   This node's header tells you that you are now at node @samp{Help-^L}, and
259 that @kbd{p} would get you back to @samp{Help-P}.  The node's title is
260 underlined; it says what the node is about (most nodes have titles).
261
262   This is a big node and it does not all fit on your display screen.
263 You can tell that there is more that is not visible because you
264 can see the string @samp{--Top-----} rather than @samp{--All----} near
265 the bottom right corner of the screen.
266
267   The Space, Delete and @kbd{B} commands exist to allow you to ``move
268 around'' in a node that does not all fit on the screen at once.
269 Space moves forward, to show what was below the bottom of the screen.
270 Delete moves backward, to show what was above the top of the screen
271 (there is not anything above the top until you have typed some spaces).
272
273 >> Now try typing a Space (afterward, type a Delete to return here).
274
275   When you type the space, the two lines that were at the bottom of
276 the screen appear at the top, followed by more lines.  Delete takes
277 the two lines from the top and moves them to the bottom,
278 @emph{usually}, but if there are not a full screen's worth of lines
279 above them they may not make it all the way to the bottom.
280
281   If you type Space when there is no more to see, it rings the
282 bell and otherwise does nothing.  The same goes for Delete when
283 the header of the node is visible.
284
285   If your screen is ever garbaged, you can tell Info to print it out
286 again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down ``Control'' and
287 type an @key{L} or @kbd{l}).
288
289 >> Type @kbd{C-l} now.
290
291   To move back to the beginning of the node you are on, you can type
292 a lot of Deletes.  You can also type simply @kbd{b} for beginning.
293 >> Try that now.  (We have put in enough verbiage to push this past
294 the first screenful, but screens are so big nowadays that perhaps it
295 isn't enough.  You may need to shrink your Emacs or Info window.)
296 Then come back, with Spaces.
297
298   If your screen is very tall, all of this node might fit at once.
299 In that case, "b" won't do anything.  Sorry; what can we do?
300
301   You have just learned a considerable number of commands.  If you
302 want to use one but have trouble remembering which, you should type
303 a @key{?} which prints out a brief list of commands.  When you are
304 finished looking at the list, make it go away by pressing @key{SPC}
305 repeatedly.
306
307 >> Type a @key{?} now.  Press @key{SPC} to see consecutive screenfuls of
308 >> the list until finished.
309
310   From now on, you will encounter large nodes without warning, and
311 will be expected to know how to use Space and Delete to move
312 around in them without being told.  Since not all terminals have
313 the same size screen, it would be impossible to warn you anyway.
314
315 >> Now type @kbd{n} to see the description of the @kbd{m} command.
316
317 @node Help-M, Help-Adv, Help-^L, Getting Started
318 @comment  node-name,  next,  previous,  up
319 @section Menus
320
321 Menus and the @kbd{m} command
322
323   With only the @kbd{n} and @kbd{p} commands for moving between nodes, nodes
324 are restricted to a linear sequence.  Menus allow a branching
325 structure.  A menu is a list of other nodes you can move to.  It is
326 actually just part of the text of the node formatted specially so that
327 Info can interpret it.  The beginning of a menu is always identified
328 by a line which starts with @samp{* Menu:}.  A node contains a menu if and
329 only if it has a line in it which starts that way.  The only menu you
330 can use at any moment is the one in the node you are in.  To use a
331 menu in any other node, you must move to that node first.
332
333   After the start of the menu, each line that starts with a @samp{*}
334 identifies one subtopic.  The line usually contains a brief name
335 for the subtopic (followed by a @samp{:}), the name of the node that talks
336 about that subtopic, and optionally some further description of the
337 subtopic.  Lines in the menu that do not start with a @samp{*} have no
338 special meaning---they are only for the human reader's benefit and do
339 not define additional subtopics.  Here is an example:
340
341 @example
342 * Foo:  FOO's Node      This tells about FOO
343 @end example
344
345 The subtopic name is Foo, and the node describing it is @samp{FOO's Node}.
346 The rest of the line is just for the reader's Information.
347 [[ But this line is not a real menu item, simply because there is
348 no line above it which starts with @samp{* Menu:}.]]
349
350   When you use a menu to go to another node (in a way that will be
351 described soon), what you specify is the subtopic name, the first
352 thing in the menu line.  Info uses it to find the menu line, extracts
353 the node name from it, and goes to that node.  The reason that there
354 is both a subtopic name and a node name is that the node name must be
355 meaningful to the computer and may therefore have to be ugly looking.
356 The subtopic name can be chosen just to be convenient for the user to
357 specify.  Often the node name is convenient for the user to specify
358 and so both it and the subtopic name are the same.  There is an
359 abbreviation for this:
360
361 @example
362 * Foo::   This tells about FOO
363 @end example
364
365 @noindent
366 This means that the subtopic name and node name are the same; they are
367 both @samp{Foo}.
368
369 >> Now use Spaces to find the menu in this node, then come back to
370    the front with a @kbd{b} and some Spaces.  As you see, a menu is
371    actually visible in its node.  If you cannot find a menu in a node
372    by looking at it, then the node does not have a menu and the
373    @kbd{m} command is not available.
374
375   The command to go to one of the subnodes is @kbd{m}---but @emph{do
376 not do it yet!}  Before you use @kbd{m}, you must understand the
377 difference between commands and arguments.  So far, you have learned
378 several commands that do not need arguments.  When you type one, Info
379 processes it and is instantly ready for another command.  The @kbd{m}
380 command is different: it is incomplete without the @dfn{name of the
381 subtopic}.  Once you have typed @kbd{m}, Info tries to read the
382 subtopic name.
383
384   Now look for the line containing many dashes near the bottom of the
385 screen.  There is one more line beneath that one, but usually it is
386 blank.  If it is empty, Info is ready for a command, such as @kbd{n}
387 or @kbd{b} or Space or @kbd{m}.  If that line contains text ending
388 in a colon, it means Info is trying to read the @dfn{argument} to a
389 command.  At such times, commands do not work, because Info tries to
390 use them as the argument.  You must either type the argument and
391 finish the command you started, or type @kbd{Control-g} to cancel the
392 command.  When you have done one of those things, the line becomes
393 blank again.
394
395   The command to go to a subnode via a menu is @kbd{m}.  After you type
396 the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }.
397 You must then type the name of the subtopic you want, and end it with
398 a @key{RET}.
399
400   You can abbreviate the subtopic name.  If the abbreviation is not
401 unique, the first matching subtopic is chosen.  Some menus put
402 the shortest possible abbreviation for each subtopic name in capital
403 letters, so you can see how much you need to type.  It does not
404 matter whether you use upper case or lower case when you type the
405 subtopic.  You should not put any spaces at the end, or inside of the
406 item name, except for one space where a space appears in the item in
407 the menu.
408
409   You can also use the @dfn{completion} feature to help enter the subtopic
410 name.  If you type the Tab key after entering part of a name, it will
411 magically fill in more of the name---as much as follows uniquely from
412 what you have entered.
413
414   If you move the cursor to one of the menu subtopic lines, then you do
415 not need to type the argument: you just type a Return, and it stands for
416 the subtopic of the line you are on.
417
418 Here is a menu to give you a chance to practice.  This menu gives you
419 three ways of going to one place, Help-FOO:
420
421 @menu
422 * Foo:  Help-FOO.       A node you can visit for fun.
423 * Bar:  Help-FOO.       Strange!  two ways to get to the same place.
424 * Help-FOO::            And yet another!
425 @end menu
426
427 >>  Now type just an @kbd{m} and see what happens:
428
429   Now you are ``inside'' an @kbd{m} command.  Commands cannot be used
430 now; the next thing you will type must be the name of a subtopic.
431
432   You can change your mind about doing the @kbd{m} by typing Control-g.
433
434 >> Try that now;  notice the bottom line clear.
435
436 >> Then type another @kbd{m}.
437
438 >> Now type @samp{BAR} item name.  Do not type Return yet.
439
440   While you are typing the item name, you can use the Delete key to
441 cancel one character at a time if you make a mistake.
442
443 >> Type one to cancel the @samp{R}.  You could type another @samp{R} to
444    replace it.  You do not have to, since @samp{BA} is a valid abbreviation.
445
446 >> Now you are ready to go.  Type a @key{RET}.
447
448   After visiting Help-FOO, you should return here.
449
450 >> Type @kbd{n} to see more commands.
451
452 @c If a menu appears at the end of this node, remove it.
453 @c It is an accident of the menu updating command.
454
455 Here is another way to get to  Help-FOO, a menu.  You can ignore this
456 if you want, or else try it (but then please come back to here).
457
458 @menu
459 * Help-FOO::
460 @end menu
461
462 @node Help-FOO,  ,  , Help-M
463 @comment  node-name,  next,  previous,  up
464 @subsection The @kbd{u} command
465
466   Congratulations!  This is the node @samp{Help-FOO}.  Unlike the other
467 nodes you have seen, this one has an @samp{Up}: @samp{Help-M}, the node you
468 just came from via the @kbd{m} command.  This is the usual
469 convention---the nodes you reach from a menu have @samp{Up} nodes that lead
470 back to the menu.  Menus move Down in the tree, and @samp{Up} moves Up.
471 @samp{Previous}, on the other hand, is usually used to ``stay on the same
472 level but go backwards''
473
474   You can go back to the node @samp{Help-M} by typing the command
475 @kbd{u} for ``Up''.  That puts you at the @emph{front} of the
476 node---to get back to where you were reading you have to type
477 some @key{SPC}s.
478
479 >> Now type @kbd{u} to move back up to @samp{Help-M}.
480
481 @node Help-Adv, Help-Q, Help-M, Getting Started
482 @comment  node-name,  next,  previous,  up
483 @section Some advanced Info commands
484
485   The course is almost over, so please stick with it to the end.
486
487   If you have been moving around to different nodes and wish to
488 retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will
489 do that, one node-step at a time.  As you move from node to node, Info
490 records the nodes where you have been in a special history list.  The
491 @kbd{l} command revisits nodes in the history list; each successive
492 @kbd{l} command moves one step back through the history.
493
494   If you have been following directions, ad @kbd{l} command now will get
495 you back to @samp{Help-M}.  Another @kbd{l} command would undo the
496 @kbd{u} and get you back to @samp{Help-FOO}.  Another @kbd{l} would undo
497 the @kbd{m} and get you back to @samp{Help-M}.
498
499 >> Try typing three @kbd{l}'s, pausing in between to see what each
500     @kbd{l} does.
501
502 Then follow directions again and you will end up back here.
503
504   Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to
505 where @emph{you} last were, whereas @kbd{p} always moves to the node
506 which the header says is the @samp{Previous} node (from this node, to
507 @samp{Help-M}).
508
509   The @samp{d} command gets you instantly to the Directory node.
510 This node, which is the first one you saw when you entered Info,
511 has a menu which leads (directly, or indirectly through other menus),
512 to all the nodes that exist.
513
514 >> Try doing a @samp{d}, then do an @kbd{l} to return here (yes,
515    @emph{do} return).
516
517   Sometimes, in Info documentation, you will see a cross reference.
518 Cross references look like this: @xref{Help-Cross, Cross}.  That is a
519 real, live cross reference which is named @samp{Cross} and points at
520 the node named @samp{Help-Cross}.
521
522   If you wish to follow a cross reference, you must use the @samp{f}
523 command.  The @samp{f} must be followed by the cross reference name
524 (in this case, @samp{Cross}).  While you enter the name, you can use the
525 Delete key to edit your input.  If you change your mind about following
526 any reference, you can use @kbd{Control-g} to cancel the command.
527
528   Completion is available in the @samp{f} command; you can complete among
529 all the cross reference names in the current node by typing a Tab.
530
531 >> Type @samp{f}, followed by @samp{Cross}, and a @key{RET}.
532
533   To get a list of all the cross references in the current node, you can
534 type @kbd{?} after an @samp{f}.  The @samp{f} continues to await a
535 cross reference name even after printing the list, so if you don't
536 actually want to follow a reference, you should type a @kbd{Control-g}
537 to cancel the @samp{f}.
538
539 >> Type "f?" to get a list of the cross references in this node.  Then
540    type a @kbd{Control-g} and see how the @samp{f} gives up.
541
542 >> Now type @kbd{n} to see the last node of the course.
543
544 @c If a menu appears at the end of this node, remove it.
545 @c It is an accident of the menu updating command.
546
547 @node Help-Cross,  ,  , Help-Adv
548 @subsection The node reached by the cross reference in Info
549
550   This is the node reached by the cross reference named @samp{Cross}.
551
552   While this node is specifically intended to be reached by a cross
553 reference, most cross references lead to nodes that ``belong'' someplace
554 else far away in the structure of Info.  So you cannot expect the
555 footnote to have a @samp{Next}, @samp{Previous} or @samp{Up} pointing
556 back to where you came from.  In general, the @kbd{l} (el) command is
557 the only way to get back there.
558
559 >> Type @kbd{l} to return to the node where the cross reference was.
560
561 @node Help-Q,  , Help-Adv, Getting Started
562 @comment  node-name,  next,  previous,  up
563 @section Quitting Info
564
565   To get out of Info, back to what you were doing before, type @kbd{q}
566 for @dfn{Quit}.
567
568   This is the end of the course on using Info.  There are some other
569 commands that are meant for experienced users; they are useful, and you
570 can find them by looking in the directory node for documentation on
571 Info.  Finding them will be a good exercise in using Info in the usual
572 manner.
573
574 >> Type @samp{d} to go to the Info directory node; then type
575    @samp{mInfo} and Return, to get to the node about Info and
576    see what other help is available.
577
578
579 @node Advanced Info
580 @chapter Info for Experts
581
582 This chapter describes various advanced Info commands, and how to write
583 an Info as distinct from a Texinfo file.  (However, in most cases, writing a
584 Texinfo file is better, since you can use it @emph{both} to generate an
585 Info file and to make a printed manual.  @xref{Top,, Overview of
586 Texinfo, texinfo, Texinfo}.)
587
588 @menu
589 * Expert::               Advanced Info commands: g, s, e, and 1 - 5.
590 * Add::                  Describes how to add new nodes to the hierarchy.
591                            Also tells what nodes look like.
592 * Menus::                How to add to or create menus in Info nodes.
593 * Cross-refs::           How to add cross-references to Info nodes.
594 * Tags::                 How to make tag tables for Info files.
595 * Checking::             Checking an Info File
596 * Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
597 @end menu
598
599 @node Expert, Add,  , Advanced Info
600 @comment  node-name,  next,  previous,  up
601 @section Advanced Info Commands
602
603 @kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}
604
605 If you know a node's name, you can go there by typing @kbd{g}, the
606 name, and @key{RET}.  Thus, @kbd{gTop@key{RET}} would go to the node
607 called @samp{Top} in this file (its directory node).
608 @kbd{gExpert@key{RET}} would come back here.
609
610 Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
611
612 To go to a node in another file, you can include the filename in the
613 node name by putting it at the front, in parentheses.  Thus,
614 @kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
615 node @samp{Top} in the file @file{dir}.
616
617 The node name @samp{*} specifies the whole file.  So you can look at
618 all of the current file by typing @kbd{g*@key{RET}} or all of any
619 other file with @kbd{g(FILENAME)@key{RET}}.
620
621 The @kbd{s} command allows you to search a whole file for a string.
622 It switches to the next node if and when that is necessary.  You
623 type @kbd{s} followed by the string to search for, terminated by
624 @key{RET}.  To search for the same string again, just @kbd{s} followed
625 by @key{RET} will do.  The file's nodes are scanned in the order
626 they are in in the file, which has no necessary relationship to the
627 order that they may be in in the tree structure of menus and @samp{next}
628 pointers.  But normally the two orders are not very different.  In any
629 case, you can always do a @kbd{b} to find out what node you have
630 reached, if the header is not visible (this can happen, because @kbd{s}
631 puts your cursor at the occurrence of the string, not at the beginning
632 of the node).
633
634 If you grudge the system each character of type-in it requires, you
635 might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...
636 @kbd{9}.  They are short for the @kbd{m} command together with an
637 argument.  @kbd{1} goes through the first item in the current node's
638 menu; @kbd{2} goes through the second item, etc.
639
640 If your display supports multiple fonts, and you are using Emacs' Info
641 mode to read Info files, the @samp{*} for the fifth menu item is
642 underlined, and so is the @samp{*} for the ninth item; these underlines
643 make it easy to see at a glance which number to use for an item.
644
645 On ordinary terminals, you won't have underlining.  If you need to
646 actually count items, it is better to use @kbd{m} instead, and specify
647 the name.
648
649 The Info command @kbd{e} changes from Info mode to an ordinary
650 Emacs editing mode, so that you can edit the text of the current node.
651 Type @kbd{C-c C-c} to switch back to Info.  The @kbd{e} command is allowed
652 only if the variable @code{Info-enable-edit} is non-@code{nil}.
653
654 @node Add, Menus, Expert, Advanced Info
655 @comment  node-name,  next,  previous,  up
656 @section Adding a new node to Info
657
658 To add a new topic to the list in the Info directory, you must:
659 @enumerate
660 @item
661 Create some nodes, in some file, to document that topic.
662 @item
663 Put that topic in the menu in the directory.  @xref{Menus, Menu}.
664 @end enumerate
665
666 Usually, the way to create the nodes is with Texinfo (@pxref{Top,,
667 Overview of Texinfo, texinfo, Texinfo}); this has the advantage that you
668 can also make a printed manual from them.  However, if you want to edit
669 an Info file, here is how.
670
671 The new node can live in an existing documentation file, or in a new
672 one.  It must have a @key{^_} character before it (invisible to the
673 user; this node has one but you cannot see it), and it ends with either
674 a @key{^_}, a @key{^L}, or the end of file.  Note: If you put in a
675 @key{^L} to end a new node, be sure that there is a @key{^_} after it
676 to start the next one, since @key{^L} cannot @emph{start} a node.
677 Also, a nicer way to make a node boundary be a page boundary as well
678 is to put a @key{^L} @emph{right after} the @key{^_}.
679
680   The @key{^_} starting a node must be followed by a newline or a
681 @key{^L} newline, after which comes the node's header line.  The header
682 line must give the node's name (by which Info finds it), and state the
683 names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there
684 are any).  As you can see, this node's @samp{Up} node is the node
685 @samp{Top}, which points at all the documentation for Info.  The
686 @samp{Next} node is @samp{Menus}.
687
688   The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},
689 may appear in any order, anywhere in the header line, but the
690 recommended order is the one in this sentence.  Each keyword must be
691 followed by a colon, spaces and tabs, and then the appropriate name.
692 The name may be terminated with a tab, a comma, or a newline.  A space
693 does not end it; node names may contain spaces.  The case of letters
694 in the names is insignificant.
695
696   A node name has two forms.  A node in the current file is named by
697 what appears after the @samp{Node: } in that node's first line.  For
698 example, this node's name is @samp{Add}.  A node in another file is
699 named by @samp{(@var{filename})@var{node-within-file}}, as in
700 @samp{(info)Add} for this node.  If the file name starts with ``./'',
701 then it is relative to the current directory; otherwise, it is relative
702 starting from the standard Info file directory of your site.
703 The name @samp{(@var{filename})Top} can be abbreviated to just
704 @samp{(@var{filename})}.  By convention, the name @samp{Top} is used for
705 the ``highest'' node in any single file---the node whose @samp{Up} points
706 out of the file.  The Directory node is @file{(dir)}.  The @samp{Top} node
707 of a document file listed in the Directory should have an @samp{Up:
708 (dir)} in it.
709
710   The node name @kbd{*} is special: it refers to the entire file.
711 Thus, @kbd{g*} shows you the whole current file.  The use of the
712 node @kbd{*} is to make it possible to make old-fashioned,
713 unstructured files into nodes of the tree.
714
715   The @samp{Node:} name, in which a node states its own name, must not
716 contain a filename, since Info when searching for a node does not expect
717 one to be there.  The @samp{Next}, @samp{Previous} and @samp{Up} names
718 may contain them.  In this node, since the @samp{Up} node is in the same
719 file, it was not necessary to use one.
720
721   Note that the nodes in this file have a file name in the header
722 line.  The file names are ignored by Info, but they serve as comments
723 to help identify the node for the user.
724
725 @node Menus, Cross-refs, Add, Advanced Info
726 @comment  node-name,  next,  previous,  up
727 @section How to Create Menus
728
729   Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
730 The @kbd{m} command searches the current node's menu for the topic which it
731 reads from the terminal.
732
733   A menu begins with a line starting with @samp{* Menu:}.  The rest of the
734 line is a comment.  After the starting line, every line that begins
735 with a @samp{* } lists a single topic.  The name of the topic--the
736 argument that the user must give to the @kbd{m} command to select this
737 topic---comes right after the star and space, and is followed by a
738 colon, spaces and tabs, and the name of the node which discusses that
739 topic.  The node name, like node names following @samp{Next}, @samp{Previous}
740 and @samp{Up}, may be terminated with a tab, comma, or newline; it may also
741 be terminated with a period.
742
743   If the node name and topic name are the same, then rather than
744 giving the name twice, the abbreviation @samp{* NAME::} may be used
745 (and should be used, whenever possible, as it reduces the visual
746 clutter in the menu).
747
748   It is considerate to choose the topic names so that they differ
749 from each other very near the beginning---this allows the user to type
750 short abbreviations.  In a long menu, it is a good idea to capitalize
751 the beginning of each item name which is the minimum acceptable
752 abbreviation for it (a long menu is more than 5 or so entries).
753
754   The nodes listed in a node's menu are called its ``subnodes'', and it
755 is their ``superior''.  They should each have an @samp{Up:} pointing at
756 the superior.  It is often useful to arrange all or most of the subnodes
757 in a sequence of @samp{Next} and @samp{Previous} pointers so that
758 someone who wants to see them all need not keep revisiting the Menu.
759
760   The Info Directory is simply the menu of the node @samp{(dir)Top}---that
761 is, node @samp{Top} in file @file{.../info/dir}.  You can put new entries
762 in that menu just like any other menu.  The Info Directory is @emph{not} the
763 same as the file directory called @file{info}.  It happens that many of
764 Info's files live on that file directory, but they do not have to; and
765 files on that directory are not automatically listed in the Info
766 Directory node.
767
768   Also, although the Info node graph is claimed to be a ``hierarchy'',
769 in fact it can be @emph{any} directed graph.  Shared structures and
770 pointer cycles are perfectly possible, and can be used if they are
771 appropriate to the meaning to be expressed.  There is no need for all
772 the nodes in a file to form a connected structure.  In fact, this file
773 has two connected components.  You are in one of them, which is under
774 the node @samp{Top}; the other contains the node @samp{Help} which the
775 @kbd{h} command goes to.  In fact, since there is no garbage
776 collector, nothing terrible happens if a substructure is not pointed
777 to, but such a substructure is rather useless since nobody can
778 ever find out that it exists.
779
780 @node Cross-refs, Tags, Menus, Advanced Info
781 @comment  node-name,  next,  previous,  up
782 @section Creating Cross References
783
784   A cross reference can be placed anywhere in the text, unlike a menu
785 item which must go at the front of a line.  A cross reference looks
786 like a menu item except that it has @samp{*note} instead of @kbd{*}.
787 It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are
788 so often part of node names.  If you wish to enclose a cross reference
789 in parentheses, terminate it with a period first.  Here are two
790 examples of cross references pointers:
791
792 @example
793 *Note details: commands.  (See *note 3: Full Proof.)
794 @end example
795
796 They are just examples.  The places they ``lead to'' do not really exist!
797
798 @node Tags, Checking, Cross-refs, Advanced Info
799 @comment  node-name,  next,  previous,  up
800 @section Tag Tables for Info Files
801
802   You can speed up the access to nodes of a large Info file by giving
803 it a tag table.  Unlike the tag table for a program, the tag table for
804 an Info file lives inside the file itself and is used
805 automatically whenever Info reads in the file.
806
807   To make a tag table, go to a node in the file using Emacs Info mode and type
808 @kbd{M-x Info-tagify}.  Then you must use @kbd{C-x C-s} to save the
809 file.
810
811   Once the Info file has a tag table, you must make certain it is up
812 to date.  If, as a result of deletion of text, any node moves back
813 more than a thousand characters in the file from the position
814 recorded in the tag table, Info will no longer be able to find that
815 node.  To update the tag table, use the @code{Info-tagify} command again.
816
817   An Info file tag table appears at the end of the file and looks like
818 this:
819
820 @example
821 ^_\f
822 Tag Table:
823 File: info, Node: Cross-refs^?21419
824 File: info,  Node: Tags^?22145
825 ^_
826 End Tag Table
827 @end example
828
829 @noindent
830 Note that it contains one line per node, and this line contains
831 the beginning of the node's header (ending just after the node name),
832 a Delete character, and the character position in the file of the
833 beginning of the node.
834
835
836 @node Checking, Emacs Info Variables, Tags, Advanced Info
837 @section Checking an Info File
838
839 When creating an Info file, it is easy to forget the name of a node when
840 you are making a pointer to it from another node.  If you put in the
841 wrong name for a node, this is not detected until someone tries to go
842 through the pointer using Info.  Verification of the Info file is an
843 automatic process which checks all pointers to nodes and reports any
844 pointers which are invalid.  Every @samp{Next}, @samp{Previous}, and
845 @samp{Up} is checked, as is every menu item and every cross reference.  In
846 addition, any @samp{Next} which does not have a @samp{Previous} pointing
847 back is reported.  Only pointers within the file are checked, because
848 checking pointers to other files would be terribly slow.  But those are
849 usually few.
850
851 To check an Info file, do @kbd{M-x Info-validate} while looking at any
852 node of the file with Emacs Info mode.
853
854 @node Emacs Info Variables, , Checking, Advanced Info
855 @section Emacs Info-mode Variables
856
857 The following variables may modify the behaviour of Info-mode in Emacs;
858 you may wish to set one or several of these variables interactively, or
859 in your @file{~/.emacs} init file.  @xref{Examining, Examining and Setting
860 Variables, Examining and Setting Variables, emacs, The GNU Emacs
861 Manual}.
862
863 @vtable @code
864 @item Info-enable-edit
865 Set to @code{nil}, disables the @samp{e} (@code{Info-edit}) command.  A
866 non-@code{nil} value enables it.  @xref{Add, Edit}.
867
868 @item Info-enable-active-nodes
869 When set to a non-@code{nil} value, allows Info to execute Lisp code
870 associated with nodes.  The Lisp code is executed when the node is
871 selected.
872
873 @item Info-directory-list
874 The list of directories to search for Info files.  Each element is a
875 string (directory name) or @code{nil} (try default directory).
876
877 @item Info-directory
878 The standard directory for Info documentation files.  Only used when the
879 function @code{Info-directory} is called.
880 @end vtable
881
882
883 @node Creating an Info File
884 @chapter Creating an Info File
885
886 @xref{Top,, Overview of Texinfo, texinfo, Texinfo}, to learn how to
887 write a Texinfo file.
888
889 @xref{Creating an Info File,,, texinfo, Texinfo}, to learn how to create
890 an Info file from a Texinfo file.
891
892 @xref{Installing an Info File,,, texinfo, Texinfo}, to learn how to
893 install an Info file after you have created one.
894
895 @bye