info.texi 53.1 KB
Newer Older
Dave Love's avatar
#  
Dave Love committed
1
\input texinfo    @c -*-texinfo-*-
2 3 4 5 6 7 8 9 10 11
@comment %**start of header
@setfilename info.info
@settitle Info
@syncodeindex fn cp
@syncodeindex vr cp
@syncodeindex ky cp
@comment %**end of header
@comment $Id: info.texi,v 1.16 2001/02/03 13:00:56 karl Exp $

@dircategory Texinfo documentation system
Dave Love's avatar
#  
Dave Love committed
12
@direntry
13
* Info: (info).                 Documentation browsing system.
Dave Love's avatar
#  
Dave Love committed
14 15 16
@end direntry

@ifinfo
17 18
This file describes how to use Info, the on-line, menu-driven GNU
documentation system.
Dave Love's avatar
#  
Dave Love committed
19

20 21
Copyright (C) 1989, 92, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
Dave Love's avatar
#  
Dave Love committed
22

Dave Love's avatar
Dave Love committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

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

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development.''

This document is part of a collection distributed under the GNU Free
Documentation License.  If you want to distribute this document
separately from the collection, you can do so by adding a copy of the
license to the document, as described in section 6 of the license.
Dave Love's avatar
#  
Dave Love committed
40 41 42
@end ifinfo

@titlepage
43 44 45 46
@title Info
@subtitle The online, hyper-text GNU documentation system
@author Brian Fox
@author and the GNU Texinfo community
Dave Love's avatar
#  
Dave Love committed
47 48
@page
@vskip 0pt plus 1filll
49 50
Copyright @copyright{} 1989, 92, 93, 96, 97, 98, 99, 2000, 2001
Free Software Foundation, Inc.
Dave Love's avatar
#  
Dave Love committed
51 52
@sp 2
Published by the Free Software Foundation @*
53 54
59 Temple Place - Suite 330 @*
Boston, MA 02111-1307, USA.
Dave Love's avatar
#  
Dave Love committed
55

Dave Love's avatar
Dave Love committed
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.1 or
any later version published by the Free Software Foundation; with no
Invariant Sections, with the Front-Cover texts being ``A GNU
Manual'', and with the Back-Cover Texts as in (a) below.  A copy of the
license is included in the section entitled ``GNU Free Documentation
License'' in the Emacs manual.

(a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
this GNU Manual, like GNU software.  Copies published by the Free
Software Foundation raise funds for GNU development.''

This document is part of a collection distributed under the GNU Free
Documentation License.  If you want to distribute this document
separately from the collection, you can do so by adding a copy of the
license to the document, as described in section 6 of the license.
Dave Love's avatar
#  
Dave Love committed
72 73
@end titlepage

74 75
@ifnottex
@node Top
Dave Love's avatar
#  
Dave Love committed
76 77 78 79
@top Info: An Introduction

Info is a program for reading documentation, which you are using now.

80 81 82 83
@ifinfo
If you are new to Info and want to learn how to use it, type the
command @kbd{h} now.  It brings you to a programmed instruction
sequence.
Dave Love's avatar
#  
Dave Love committed
84 85 86 87

To learn advanced Info commands, type @kbd{n} twice.  This brings you to
@cite{Info for Experts}, skipping over the `Getting Started' chapter.
@end ifinfo
88
@end ifnottex
Dave Love's avatar
#  
Dave Love committed
89 90 91 92

@menu
* Getting Started::             Getting started using an Info reader.
* Advanced Info::               Advanced commands within Info.
93 94
* Creating an Info File::       How to make your own Info file.
* Index::                       An Index of topics, commands, and variables.
Dave Love's avatar
#  
Dave Love committed
95 96 97 98 99 100 101 102 103
@end menu

@node Getting Started, Advanced Info, Top, Top
@comment  node-name,  next,  previous,  up
@chapter Getting Started

This first part of the Info manual describes how to get around inside
of Info.  The second part of the manual describes various advanced
Info commands, and how to write an Info as distinct from a Texinfo
104
file.  The third part briefly explains how to generate Info files from
Dave Love's avatar
#  
Dave Love committed
105 106
Texinfo files.

107 108 109 110
@ifnotinfo
This manual is primarily designed for browsing with an Info reader
program on a computer, so that you can try Info commands while reading
about them.  Reading it on paper or with an HTML browser is less
Dave Love's avatar
#  
Dave Love committed
111
effective, since you must take it on faith that the commands described
112 113 114
really do what the manual says.  By all means go through this manual
now that you have it; but please try going through the on-line version
as well.
Dave Love's avatar
#  
Dave Love committed
115

116 117
@cindex Info reader, how to invoke
@cindex entering Info
Dave Love's avatar
#  
Dave Love committed
118 119 120 121 122
There are two ways of looking at the online version of this manual:

@enumerate
@item
Type @code{info} at your shell's command line.  This approach uses a
123
small stand-alone program designed just to read Info files.
Dave Love's avatar
#  
Dave Love committed
124 125 126 127 128 129 130 131 132 133 134 135 136 137 138

@item
Type @code{emacs} at the command line; then type @kbd{C-h i} (Control
@kbd{h}, followed by @kbd{i}).  This approach uses the Info mode of the
Emacs program, an editor with many other capabilities.
@end enumerate

In either case, then type @kbd{mInfo} (just the letters), followed by
@key{RET}---the ``Return'' or ``Enter'' key.  At this point, you should
be ready to follow the instructions in this manual as you read them on
the screen.
@c FIXME! (pesch@cygnus.com, 14 dec 1992)
@c Is it worth worrying about what-if the beginner goes to somebody
@c else's Emacs session, which already has an Info running in the middle
@c of something---in which case these simple instructions won't work?
139
@end ifnotinfo
Dave Love's avatar
#  
Dave Love committed
140 141 142 143 144 145 146 147 148 149 150

@menu
* Help-Small-Screen::   Starting Info on a Small Screen
* Help::                How to use Info
* Help-P::              Returning to the Previous node
* Help-^L::             The Space, Rubout, B and ^L commands.
* Help-M::              Menus
* Help-Adv::            Some advanced Info commands
* Help-Q::              Quitting Info
@end menu

151
@node Help-Small-Screen
Dave Love's avatar
#  
Dave Love committed
152 153
@section Starting Info on a Small Screen

154
@ifnotinfo
Dave Love's avatar
#  
Dave Love committed
155 156
(In Info, you only see this section if your terminal has a small
number of lines; most readers pass by it without seeing it.)
157
@end ifnotinfo
Dave Love's avatar
#  
Dave Love committed
158

159 160
@cindex small screen, moving around
Since your terminal has a relatively small number of lines on its
Dave Love's avatar
#  
Dave Love committed
161 162
screen, it is necessary to give you special advice at the beginning.

163
If you see the text @samp{--All----} near the bottom right corner
Dave Love's avatar
#  
Dave Love committed
164 165 166
of the screen, it means the entire text you are looking at fits on the
screen.  If you see @samp{--Top----} instead, it means that there is
more text below that does not fit.  To move forward through the text
167 168 169
and see another screen full, press @key{SPC}, the Space bar.  To move
back up, press the key labeled @samp{Backspace} or @samp{DEL} (on some
keyboards, this key might be labeled @samp{Delete}).
Dave Love's avatar
#  
Dave Love committed
170 171

@ifinfo
172
Here are 40 lines of junk, so you can try Spaces and DEL and
Dave Love's avatar
#  
Dave Love committed
173 174
see what they do.  At the end are instructions of what you should do
next.
175

Dave Love's avatar
#  
Dave Love committed
176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213
@format
This is line 20
This is line 21
This is line 22
This is line 23
This is line 24
This is line 25
This is line 26
This is line 27
This is line 28
This is line 29
This is line 30
This is line 31
This is line 32
This is line 33
This is line 34
This is line 35
This is line 36
This is line 37
This is line 38
This is line 39
This is line 40
This is line 41
This is line 42
This is line 43
This is line 44
This is line 45
This is line 46
This is line 47
This is line 48
This is line 49
This is line 50
This is line 51
This is line 52
This is line 53
This is line 54
This is line 55
This is line 56
214 215 216
This is line 57
This is line 58
This is line 59
Dave Love's avatar
#  
Dave Love committed
217
@end format
218

Dave Love's avatar
#  
Dave Love committed
219
If you have managed to get here, go back to the beginning with
220 221
@kbd{DEL}, and come back here again, then you understand Space and
DEL.  So now type an @kbd{n} ---just one character; don't type
Dave Love's avatar
#  
Dave Love committed
222 223 224 225 226 227 228 229 230 231
the quotes and don't type the Return key afterward--- to
get to the normal start of the course.
@end ifinfo

@node Help, Help-P, Help-Small-Screen, Getting Started
@comment  node-name,  next,  previous,  up
@section How to use Info

You are talking to the program Info, for reading documentation.

232
@cindex node, in Info documents
Dave Love's avatar
#  
Dave Love committed
233 234
  Right now you are looking at one @dfn{Node} of Information.
A node contains text describing a specific topic at a specific
235 236
level of detail.  This node's topic is ``how to use Info''.  The mode
line says that this is node @samp{Help} in the file @file{info}.
Dave Love's avatar
#  
Dave Love committed
237

238
@cindex header of Info node
Dave Love's avatar
#  
Dave Love committed
239
  The top line of a node is its @dfn{header}.  This node's header (look at
240
it now) says that the @samp{Next} node after this one is the node
Dave Love's avatar
#  
Dave Love committed
241
called @samp{Help-P}.  An advanced Info command lets you go to any node
242 243 244 245 246 247
whose name you know.  In the stand-alone Info reader program, the
header line shows the names of this node and the info file as well.
In Emacs, the header line is displayed in a special typeface, and it
doesn't scroll off the screen when you scroll the display.  The names
of this node and of its Info file are omitted by Emacs from the header
line.
Dave Love's avatar
#  
Dave Love committed
248 249

  Besides a @samp{Next}, a node can have a @samp{Previous} or an
250 251
@samp{Up} links, or both.  As you can see, this node has all of these
links.
Dave Love's avatar
#  
Dave Love committed
252

253
@kindex n @r{(Info mode)}
Dave Love's avatar
#  
Dave Love committed
254 255 256
  Now it is time to move on to the @samp{Next} node, named @samp{Help-P}.

@format
257
>> Type @kbd{n} to move there.  Type just one character;
Dave Love's avatar
#  
Dave Love committed
258 259 260
   do not type the quotes and do not type a @key{RET} afterward.
@end format

261
@noindent
Dave Love's avatar
#  
Dave Love committed
262 263
@samp{>>} in the margin means it is really time to try a command.

264 265 266 267 268 269
@format
>> If you have a mouse, and if you already practiced typing @kbd{n}
   to get to the next node, click now with the right mouse button on
   the @samp{Next} link to do the same ``the mouse way''.
@end format

Dave Love's avatar
#  
Dave Love committed
270 271 272 273
@node Help-P, Help-^L, Help, Getting Started
@comment  node-name,  next,  previous,  up
@section Returning to the Previous node

274
@kindex p @r{(Info mode)}
Dave Love's avatar
#  
Dave Love committed
275 276 277
This node is called @samp{Help-P}.  The @samp{Previous} node, as you see,
is @samp{Help}, which is the one you just came from using the @kbd{n}
command.  Another @kbd{n} command now would take you to the next
278 279
node, @samp{Help-^L}.  In Emacs, @kbd{n} runs the Emacs command
@code{Info-next}, and @kbd{p} runs @code{Info-prev}.
Dave Love's avatar
#  
Dave Love committed
280 281

@format
282 283 284 285
>> But do not do that yet.  First, try the @kbd{p} command, or click
   the mouse on the @samp{Prev} link, which takes you to the
   @samp{Previous} node.  When you get there, you can do an @kbd{n}
   again to return here.
Dave Love's avatar
#  
Dave Love committed
286 287 288 289 290 291 292 293
@end format

  This all probably seems insultingly simple so far, but @emph{do not} be
led into skimming.  Things will get more complicated soon.  Also,
do not try a new command until you are told it is time to.  Otherwise,
you may make Info skip past an important warning that was coming up.

@format
294 295
>> Now do an @kbd{n}, or click the mouse on the @samp{Next} link, to
   get to the node @samp{Help-^L} and learn more.
Dave Love's avatar
#  
Dave Love committed
296 297 298 299
@end format

@node Help-^L, Help-M, Help-P, Getting Started
@comment  node-name,  next,  previous,  up
300
@section The Space, DEL, B and ^L commands.
Dave Love's avatar
#  
Dave Love committed
301

302 303 304 305
  This node's mode line tells you that you are now at node @samp{Help-^L},
and the header line tells you that @kbd{p} would get you back to
@samp{Help-P}.  The node's title is underlined; it says what the node
is about (most nodes have titles).
Dave Love's avatar
#  
Dave Love committed
306 307 308 309 310 311

  This is a big node and it does not all fit on your display screen.
You can tell that there is more that is not visible because you
can see the string @samp{--Top-----} rather than @samp{--All----} near
the bottom right corner of the screen.

312 313 314 315 316 317 318 319 320 321 322 323
@kindex SPC @r{(Info mode)}
@kindex DEL @r{(Info mode)}
@kindex BACKSPACE @r{(Info mode)}
@findex Info-scroll-up
@findex Info-scroll-down
  The Space, Backspace (or DEL) and @kbd{b} commands exist to allow
you to ``move around'' in a node that does not all fit on the screen
at once.  Space moves forward, to show what was below the bottom of
the screen.  DEL or Backspace moves backward, to show what was above
the top of the screen (there is not anything above the top until you
have typed some spaces).  In Emacs, Space runs the command
@code{Info-scroll-up}, while Backspace runs @code{Info-scroll-down}.
Dave Love's avatar
#  
Dave Love committed
324 325

@format
326
>> Now try typing a Space (afterward, type a Backspace to return here).
Dave Love's avatar
#  
Dave Love committed
327 328
@end format

329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363
  When you type the Space, the two lines that were at the bottom of
the screen appear at the top, followed by more lines.  DEL or
Backspace takes the two lines from the top and moves them to the
bottom, @emph{usually}, but if there are not a full screen's worth of
lines above them they may not make it all the way to the bottom.

  If you are reading this in Emacs, note that the header line is
always visible, never scrolling off the display.  That way, you can
always see the @samp{Next}, @samp{Prev}, and @samp{Up} links, and you
can conveniently go to one of these links from anywhere in the node by
clicking the mouse on one of these links.

@cindex reading Info documents top to bottom
@cindex Info documents as tutorials
  Space and DEL not only move forward and backward through the current
node.  When these keys hit the beginning or the end of the current
node, they move to preceding or subsequent nodes.  Specifically, they
scroll through all the nodes in an Info file as a single logical
sequence.  In this sequence, a node's subnodes appear following their
parent.  If a node has a menu, Space takes you into the subnodes
listed in the menu, one by one.  Once you reach the end of a node, and
have seen all of its subnodes, Space takes you to the next node or to
the parent's next node.  This is so you could read the entire manual
top to bottom by just typing Space.

@kindex PAGEUP @r{(Info mode)}
@kindex PAGEDOWN @r{(Info mode)}
  Many keyboards nowadays have two scroll keys labeled @samp{PageUp}
and @samp{PageDown} (or maybe @samp{Prior} and @samp{Next}).  If your
keyboard has these keys, you can use them to move forward and backward
through the text, like with Space and Backspace.  However, unlike
Space and Backspace, PageUp and PageDown keys will never scroll beyond
the beginning or the end of the current node.

@kindex C-l @r{(Info mode)}
Dave Love's avatar
#  
Dave Love committed
364
  If your screen is ever garbaged, you can tell Info to print it out
365 366
again by typing @kbd{C-l} (@kbd{Control-L}, that is---hold down
``Control'' and type an @key{L} or @kbd{l}).
Dave Love's avatar
#  
Dave Love committed
367 368 369 370 371

@format
>> Type @kbd{C-l} now.
@end format

372
@kindex b @r{(Info mode)}
Dave Love's avatar
#  
Dave Love committed
373
  To move back to the beginning of the node you are on, you can type
374 375
a lot of Backspaces.  You can also type simply @kbd{b} for beginning.

Dave Love's avatar
#  
Dave Love committed
376 377
@format
>> Try that now.  (We have put in enough verbiage to push this past
378 379 380
   the first screenful, but screens are so big nowadays that perhaps it
   isn't enough.  You may need to shrink your Emacs or Info window.)
   Then come back, with Spaces.
Dave Love's avatar
#  
Dave Love committed
381 382
@end format

383 384
  If your screen is very tall, all of this node might fit at once.
In that case, @kbd{b} won't do anything.  Sorry; what can we do?
Dave Love's avatar
#  
Dave Love committed
385

386 387
@kindex ? @r{(Info mode)}
@findex Info-summary
Dave Love's avatar
#  
Dave Love committed
388 389
  You have just learned a considerable number of commands.  If you
want to use one but have trouble remembering which, you should type
390 391 392
a @key{?} (in Emacs it runs the @code{Info-summary} command) which
prints out a brief list of commands.  When you are finished looking at
the list, make it go away by typing a Space repeatedly.
Dave Love's avatar
#  
Dave Love committed
393 394

@format
395 396 397
>> Type a @key{?} now.  Press @key{SPC} to see consecutive screenfuls of
   the list until finished.  Then type @key{SPC} several times, until
   it goes away.
Dave Love's avatar
#  
Dave Love committed
398 399
@end format

400 401 402 403
  (If you are using the stand-alone Info reader, type @kbd{C-x 0} to
return here, that is---press and hold ``Control'', type an @kbd{x},
then release ``Control'' and @kbd{x}, and press @kbd{0}---a zero, not
the letter ``o''.)
Dave Love's avatar
#  
Dave Love committed
404 405

  From now on, you will encounter large nodes without warning, and
406
will be expected to know how to use Space and Backspace to move
Dave Love's avatar
#  
Dave Love committed
407 408 409 410
around in them without being told.  Since not all terminals have
the same size screen, it would be impossible to warn you anyway.

@format
411 412
>> Now type @kbd{n}, or click the mouse on the @samp{Next} link, to
   see the description of the @kbd{m} command.
Dave Love's avatar
#  
Dave Love committed
413 414 415 416
@end format

@node Help-M, Help-Adv, Help-^L, Getting Started
@comment  node-name,  next,  previous,  up
417 418 419 420 421 422 423 424 425 426 427 428 429 430
@section Menus and the @kbd{m} command

@cindex menus in an Info document
@cindex Info menus
  With only the @kbd{n} (next) and @kbd{p} (previous) commands for
moving between nodes, nodes are restricted to a linear sequence.
Menus allow a branching structure.  A menu is a list of other nodes
you can move to.  It is actually just part of the text of the node
formatted specially so that Info can interpret it.  The beginning of a
menu is always identified by a line which starts with @samp{* Menu:}.
A node contains a menu if and only if it has a line in it which starts
that way.  The only menu you can use at any moment is the one in the
node you are in.  To use a menu in any other node, you must move to
that node first.
Dave Love's avatar
#  
Dave Love committed
431 432 433 434 435 436 437 438 439 440

  After the start of the menu, each line that starts with a @samp{*}
identifies one subtopic.  The line usually contains a brief name
for the subtopic (followed by a @samp{:}), the name of the node that talks
about that subtopic, and optionally some further description of the
subtopic.  Lines in the menu that do not start with a @samp{*} have no
special meaning---they are only for the human reader's benefit and do
not define additional subtopics.  Here is an example:

@example
441
* Foo:  Node about FOO      This tells about FOO
Dave Love's avatar
#  
Dave Love committed
442 443
@end example

444 445 446 447
The subtopic name is Foo, and the node describing it is @samp{Node
about FOO}.  The rest of the line is just for the reader's
Information.  [[ But this line is not a real menu item, simply because
there is no line above it which starts with @samp{* Menu:}.]]
Dave Love's avatar
#  
Dave Love committed
448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475

  When you use a menu to go to another node (in a way that will be
described soon), what you specify is the subtopic name, the first
thing in the menu line.  Info uses it to find the menu line, extracts
the node name from it, and goes to that node.  The reason that there
is both a subtopic name and a node name is that the node name must be
meaningful to the computer and may therefore have to be ugly looking.
The subtopic name can be chosen just to be convenient for the user to
specify.  Often the node name is convenient for the user to specify
and so both it and the subtopic name are the same.  There is an
abbreviation for this:

@example
* Foo::   This tells about FOO
@end example

@noindent
This means that the subtopic name and node name are the same; they are
both @samp{Foo}.

@format
>> Now use Spaces to find the menu in this node, then come back to
   the front with a @kbd{b} and some Spaces.  As you see, a menu is
   actually visible in its node.  If you cannot find a menu in a node
   by looking at it, then the node does not have a menu and the
   @kbd{m} command is not available.
@end format

476
@kindex m @r{(Info mode)}
Dave Love's avatar
#  
Dave Love committed
477
  The command to go to one of the subnodes is @kbd{m}---but @emph{do
478 479 480 481 482 483 484
not do it yet!}  Before you use @kbd{m}, you need to learn about
commands which prompt you for more input.  So far, you have learned
several commands that do not need additional input; when you typed
one, Info processed it and was instantly ready for another command.
The @kbd{m} command is different: it is incomplete without the
@dfn{name of the subtopic}.  Once you have typed @kbd{m}, Info tries
to read the subtopic name.
Dave Love's avatar
#  
Dave Love committed
485 486 487 488 489

  Now look for the line containing many dashes near the bottom of the
screen.  There is one more line beneath that one, but usually it is
blank.  If it is empty, Info is ready for a command, such as @kbd{n}
or @kbd{b} or Space or @kbd{m}.  If that line contains text ending
490
in a colon, it means Info is trying to read more input for the last
Dave Love's avatar
#  
Dave Love committed
491
command.  At such times, commands do not work, because Info tries to
492
use them as the input it needs.  You must either type your response and
Dave Love's avatar
#  
Dave Love committed
493 494 495 496
finish the command you started, or type @kbd{Control-g} to cancel the
command.  When you have done one of those things, the line becomes
blank again.

497
@findex Info-menu
Dave Love's avatar
#  
Dave Love committed
498 499 500
  The command to go to a subnode via a menu is @kbd{m}.  After you type
the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }.
You must then type the name of the subtopic you want, and end it with
501
a @key{RET}.  In Emacs, @kbd{m} runs the command @code{Info-menu}.
Dave Love's avatar
#  
Dave Love committed
502

503
@cindex abbreviating Info subnodes
Dave Love's avatar
#  
Dave Love committed
504
  You can abbreviate the subtopic name.  If the abbreviation is not
505 506 507 508 509 510 511 512 513
unique, the first matching subtopic is chosen.  Some menus put
the shortest possible abbreviation for each subtopic name in capital
letters, so you can see how much you need to type.  It does not
matter whether you use upper case or lower case when you type the
subtopic.  You should not put any spaces at the end, or inside of the
item name, except for one space where a space appears in the item in
the menu.

@cindex completion of Info node names
Dave Love's avatar
#  
Dave Love committed
514 515 516 517 518 519
  You can also use the @dfn{completion} feature to help enter the subtopic
name.  If you type the Tab key after entering part of a name, it will
magically fill in more of the name---as much as follows uniquely from
what you have entered.

  If you move the cursor to one of the menu subtopic lines, then you do
520 521
not need to type the argument: you just type a @key{RET}, and it
stands for the subtopic of the line you are on.
Dave Love's avatar
#  
Dave Love committed
522

523 524
Here is a menu to give you a chance to practice.  This menu gives you
three ways of going to one place, Help-FOO:
Dave Love's avatar
#  
Dave Love committed
525 526 527 528 529 530 531 532 533 534 535 536 537 538

@menu
* Foo:  Help-FOO.       A node you can visit for fun.
* Bar:  Help-FOO.       Strange!  two ways to get to the same place.
* Help-FOO::            And yet another!
@end menu

@format
>>  Now type just an @kbd{m} and see what happens:
@end format

  Now you are ``inside'' an @kbd{m} command.  Commands cannot be used
now; the next thing you will type must be the name of a subtopic.

539 540
  You can change your mind about doing the @kbd{m} by typing
@kbd{Control-g}.
Dave Love's avatar
#  
Dave Love committed
541 542 543

@format
>> Try that now;  notice the bottom line clear.
544
@end format
Dave Love's avatar
#  
Dave Love committed
545

546
@format
Dave Love's avatar
#  
Dave Love committed
547
>> Then type another @kbd{m}.
548
@end format
Dave Love's avatar
#  
Dave Love committed
549

550 551
@format
>> Now type @kbd{BAR}, the item name.  Do not type @key{RET} yet.
Dave Love's avatar
#  
Dave Love committed
552 553
@end format

554 555 556
  While you are typing the item name, you can use the @key{DEL} (or
Backspace) key to cancel one character at a time if you make a
mistake.
Dave Love's avatar
#  
Dave Love committed
557 558

@format
559 560 561 562
>> Press @key{DEL} to cancel the @samp{R}.  You could type another @kbd{R}
   to replace it.  But you do not have to, since @samp{BA} is a valid
   abbreviation.
@end format
Dave Love's avatar
#  
Dave Love committed
563

564
@format
Dave Love's avatar
#  
Dave Love committed
565 566 567
>> Now you are ready to go.  Type a @key{RET}.
@end format

568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611
  After visiting @samp{Help-FOO}, you should return here.

  Another way to move to the menu subtopic lines and between them is
to type @key{TAB}.  Each time you type a @key{TAB}, you move to the
next subtopic line.  To move to a previous subtopic line, type
@kbd{M-@key{TAB}}---that is, press and hold the Meta key and then
press @key{TAB}.  (On some keyboards, the Meta key might be known as
``Alt''.)

  Once you move cursor to a subtopic line, press @key{RET} to go to
that subtopic's node.

@cindex mouse support in Info mode
@kindex Mouse-2 @r{(Info mode)}
  If your terminal supports a mouse, you have yet another way of going
to a subtopic.  Move your mouse pointer to the subtopic line,
somewhere between the beginning @samp{*} and the colon @samp{:} which
ends the subtopic's brief name.  You will see the subtopic's name
change its appearance (usually, its background color will change), and
the shape of the mouse pointer will change if your platform supports
that.  After a while, if you leave the mouse on that spot, a tooltip
will pop up saying ``Mouse-2: go to that node''.  (If the tooltips are
turned off or unavailable, this message is printed in the @dfn{echo
area}, the last screen line where you typed the menu subtopics in
response to the prompt.)  @kbd{Mouse-2} is the second button of your
mouse---normally the rightmost button.  So pressing @kbd{Mouse-2}
while the mouse pointer is on a menu subtopic goes to that subtopic.

@findex Info-mouse-follow-nearest-node
  More generally, @kbd{Mouse-2} in an Info buffer runs the Emacs
command @code{Info-mouse-follow-nearest-node}, which finds the nearest
link to another node and goes there.  For example, near a cross
reference it acts like @kbd{f}, in a menu it acts like @kbd{m}, on the
node's header line it acts like @kbd{n}, @kbd{p}, or @kbd{u}, etc.  At
end of the node's text @kbd{Mouse-2} moves to the next node, or up if
there's no next node.

  Here is another way to get to Help-FOO, a menu.  You can ignore this
if you want, or else try it by typing @key{TAB} and then @key{RET}, or
clicking @kbd{Mouse-2} on it (but then please come back to here).

@menu
* Help-FOO::
@end menu
Dave Love's avatar
#  
Dave Love committed
612 613 614 615 616 617 618 619

@format
>> Type @kbd{n} to see more commands.
@end format

@node Help-FOO,  ,  , Help-M
@subsection The @kbd{u} command

620 621 622 623 624 625
  Congratulations!  This is the node @samp{Help-FOO}.  It has an @samp{Up}
pointer @samp{Help-M}, the node you just came from via the @kbd{m}
command.  This is the usual convention---the nodes you reach from a menu
have @samp{Up} nodes that lead back to the menu.  Menus move Down in the
tree, and @samp{Up} moves Up.  @samp{Previous}, on the other hand, is
usually used to ``stay on the same level but go backwards''.
Dave Love's avatar
#  
Dave Love committed
626

627 628
@kindex u @r{(Info mode)}
@findex Info-up
Dave Love's avatar
#  
Dave Love committed
629
  You can go back to the node @samp{Help-M} by typing the command
630 631 632 633 634 635 636 637
@kbd{u} for ``Up'' (the Emacs command ruin by @kbd{u} is
@code{Info-up}).  That puts you at the @emph{front} of the node---to
get back to where you were reading you have to type some @key{SPC}s.
(Some Info readers, such as the one built into Emacs, put you at the
same place where you were reading in @samp{Help-M}.)

  Another way to go Up is to click on the @samp{Up} pointer shown in
the header line (provided that you have a mouse).
Dave Love's avatar
#  
Dave Love committed
638 639 640 641 642 643 644 645 646 647 648

@format
>> Now type @kbd{u} to move back up to @samp{Help-M}.
@end format

@node Help-Adv, Help-Q, Help-M, Getting Started
@comment  node-name,  next,  previous,  up
@section Some advanced Info commands

  The course is almost over, so please stick with it to the end.

649 650 651
@kindex l @r{(Info mode)}
@findex Info-last
@cindex going back in Info mode
Dave Love's avatar
#  
Dave Love committed
652 653 654 655 656 657 658
  If you have been moving around to different nodes and wish to
retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will
do that, one node-step at a time.  As you move from node to node, Info
records the nodes where you have been in a special history list.  The
@kbd{l} command revisits nodes in the history list; each successive
@kbd{l} command moves one step back through the history.

659
  If you have been following directions, ad @kbd{l} command now will get
Dave Love's avatar
#  
Dave Love committed
660 661 662 663
you back to @samp{Help-M}.  Another @kbd{l} command would undo the
@kbd{u} and get you back to @samp{Help-FOO}.  Another @kbd{l} would undo
the @kbd{m} and get you back to @samp{Help-M}.

664 665
  In Emacs, @kbd{l} runs the command @code{Info-last}.

Dave Love's avatar
#  
Dave Love committed
666 667
@format
>> Try typing three @kbd{l}'s, pausing in between to see what each
668 669
   @kbd{l} does.  Then follow directions again and you will end up
   back here.
Dave Love's avatar
#  
Dave Love committed
670 671 672 673
@end format

  Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to
where @emph{you} last were, whereas @kbd{p} always moves to the node
674 675 676 677 678 679 680 681 682 683 684 685
which the header says is the @samp{Previous} node (from this node, the
@samp{Prev} link leads to @samp{Help-M}).

@kindex d @r{(Info mode)}
@findex Info-directory
@cindex go to Directory node
  The @kbd{d} command (@code{Info-directory} in Emacs) gets you
instantly to the Directory node.  This node, which is the first one
you saw when you entered Info, has a menu which leads (directly, or
indirectly through other menus), to all the nodes that exist.  The
Directory node lists all the manuals and other Info documents that
are, or could be, installed on your system.
Dave Love's avatar
#  
Dave Love committed
686 687

@format
688
>> Try doing a @kbd{d}, then do an @kbd{l} to return here (yes,
Dave Love's avatar
#  
Dave Love committed
689 690 691
   @emph{do} return).
@end format

692 693 694 695 696 697 698 699
@kindex t @r{(Info mode)}
@findex Info-top-node
@cindex go to Top node
  The @kbd{t} command moves to the @samp{Top} node of the manual.
This is useful if you want to browse the manual's main menu, or select
some specific top-level menu item.  The Emacs command run by @kbd{t}
is @code{Info-top-node}.

Dave Love's avatar
#  
Dave Love committed
700 701 702 703 704
  Sometimes, in Info documentation, you will see a cross reference.
Cross references look like this: @xref{Help-Cross, Cross}.  That is a
real, live cross reference which is named @samp{Cross} and points at
the node named @samp{Help-Cross}.

705 706 707 708 709 710 711 712 713 714 715 716 717 718
@kindex f @r{(Info mode)}
@findex Info-follow-reference
@cindex cross references in Info documents
  If you wish to follow a cross reference, you must use the @kbd{f}
command.  The @kbd{f} must be followed by the cross reference name
(in this case, @samp{Cross}).  If the cursor is on or near the cross
reference, Info suggests the name if the nearest reference in
parentheses; typing @key{RET} will follow that reference.  You can
also type a different name, if the default is not what you want.
While you enter the name, you can use the DEL (or Backspace) key to
edit your input.  If you change your mind about following any
reference, you can use @kbd{Control-g} to cancel the command.

  Completion is available in the @kbd{f} command; you can complete among
Dave Love's avatar
#  
Dave Love committed
719 720
all the cross reference names in the current node by typing a Tab.

721 722
  @kbd{f} runs @code{Info-follow-reference} in Emacs.

Dave Love's avatar
#  
Dave Love committed
723
@format
724
>> Type @kbd{f}, followed by @kbd{Cross}, and a @key{RET}.
Dave Love's avatar
#  
Dave Love committed
725 726 727
@end format

  To get a list of all the cross references in the current node, you can
728
type @kbd{?} after an @kbd{f}.  The @kbd{f} continues to await a
Dave Love's avatar
#  
Dave Love committed
729 730
cross reference name even after printing the list, so if you don't
actually want to follow a reference, you should type a @kbd{Control-g}
731
to cancel the @kbd{f}.
Dave Love's avatar
#  
Dave Love committed
732 733

@format
734
>> Type @kbd{f?} to get a list of the cross references in this node.  Then
Dave Love's avatar
#  
Dave Love committed
735
   type a @kbd{Control-g} and see how the @samp{f} gives up.
736 737 738 739 740 741
@end format

  The @key{TAB} and @kbd{M-@key{TAB}} key, which move between
subtopics in a menu can move between cross references as well.  Once
the cursor is on a cross reference, you can press @key{RET} to follow
that reference, just like you do in a menu.
Dave Love's avatar
#  
Dave Love committed
742

743 744 745 746 747 748
  Clicking @kbd{Mouse-2} on or near a cross reference also follows the
reference.  You can see that the cross reference is mouse-sensitive by
moving the mouse pointer to the reference and watching how the
underlying text and the mouse pointer change in response.

@format
Dave Love's avatar
#  
Dave Love committed
749 750 751 752 753 754 755
>> Now type @kbd{n} to see the last node of the course.
@end format

@c If a menu appears at the end of this node, remove it.
@c It is an accident of the menu updating command.

@node Help-Cross,  ,  , Help-Adv
756
@subsection The node reached by the cross reference in Info
Dave Love's avatar
#  
Dave Love committed
757 758 759 760 761

  This is the node reached by the cross reference named @samp{Cross}.

  While this node is specifically intended to be reached by a cross
reference, most cross references lead to nodes that ``belong''
762 763 764 765
someplace else far away in the structure of an Info document.  So you
cannot expect this node to have a @samp{Next}, @samp{Previous} or
@samp{Up} links pointing back to where you came from.  In general, the
@kbd{l} (el) command is the only way to get back there.
Dave Love's avatar
#  
Dave Love committed
766 767 768 769 770 771 772 773 774

@format
>> Type @kbd{l} to return to the node where the cross reference was.
@end format

@node Help-Q,  , Help-Adv, Getting Started
@comment  node-name,  next,  previous,  up
@section Quitting Info

775 776 777
@kindex q @r{(Info mode)}
@findex Info-exit
@cindex quitting Info mode
Dave Love's avatar
#  
Dave Love committed
778
  To get out of Info, back to what you were doing before, type @kbd{q}
779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794
for @dfn{Quit}.  This runs @code{Info-exit} in Emacs.

  This is the end of the basic course on using Info.  You have learned
how to move in an Info document, and how to follow menus and cross
references.  This makes you ready for reading manuals top to bottom,
as new users should do when they learn a new package.

  Another set of Info commands is useful when you need to find
something quickly in a manual---that is, when you need to use a manual
as a reference rather than as a tutorial.  We urge you to make learn
these search commands as well.  If you want to do that now, follow this
cross reference to @ref{Info Search}.

Yet another set of commands are meant for experienced users; you can
find them by looking in the Directory node for documentation on Info.
Finding them will be a good exercise in using Info in the usual
Dave Love's avatar
#  
Dave Love committed
795 796 797
manner.

@format
798 799
>> Type @kbd{d} to go to the Info directory node; then type
   @kbd{mInfo} and Return, to get to the node about Info and
Dave Love's avatar
#  
Dave Love committed
800 801 802
   see what other help is available.
@end format

803 804

@node Advanced Info
Dave Love's avatar
#  
Dave Love committed
805 806
@chapter Info for Experts

807 808 809 810 811 812 813 814 815 816
  This chapter describes various advanced Info commands.  (If you are
using a stand-alone Info reader, there are additional commands
specific to it, which are documented in several chapters of @ref{Top,,
GNU Info, info-stnd, GNU Info}.)

  This chapter also explains how to write an Info as distinct from a
Texinfo file.  (However, in most cases, writing a Texinfo file is
better, since you can use it @emph{both} to generate an Info file and
to make a printed manual.  @xref{Top,, Overview of Texinfo, texinfo,
Texinfo: The GNU Documentation Format}.)
Dave Love's avatar
#  
Dave Love committed
817 818 819

@menu
* Expert::               Advanced Info commands: g, s, e, and 1 - 5.
820
* Info Search::          How to search Info documents for specific subjects.
Dave Love's avatar
#  
Dave Love committed
821 822 823 824 825 826 827 828 829
* Add::                  Describes how to add new nodes to the hierarchy.
                           Also tells what nodes look like.
* Menus::                How to add to or create menus in Info nodes.
* Cross-refs::           How to add cross-references to Info nodes.
* Tags::                 How to make tags tables for Info files.
* Checking::             Checking an Info File
* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
@end menu

830
@node Expert, Info Search,  , Advanced Info
Dave Love's avatar
#  
Dave Love committed
831 832 833
@comment  node-name,  next,  previous,  up
@section Advanced Info Commands

834 835 836
Here are some more Info commands that make it easier to move around.

@unnumberedsubsec @kbd{g} goes to a node by name
Dave Love's avatar
#  
Dave Love committed
837

838 839 840 841
@kindex g @r{(Info mode)}
@findex Info-goto-node
@cindex go to a node by name
  If you know a node's name, you can go there by typing @kbd{g}, the
Dave Love's avatar
#  
Dave Love committed
842
name, and @key{RET}.  Thus, @kbd{gTop@key{RET}} would go to the node
843 844 845
called @samp{Top} in this file.  (This is equivalent to @kbd{t}, see
@ref{Help-Adv}.)  @kbd{gExpert@key{RET}} would come back here.
@kbd{g} in Emacs runs the command @code{Info-goto-node}.
Dave Love's avatar
#  
Dave Love committed
846

847 848 849
  Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
But it does allow completion, so you can type @key{TAB} to complete a
partial node name.
Dave Love's avatar
#  
Dave Love committed
850

851 852
@cindex go to another Info file
  To go to a node in another file, you can include the file name in the
Dave Love's avatar
#  
Dave Love committed
853 854
node name by putting it at the front, in parentheses.  Thus,
@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
855 856
the node @samp{Top} in the Info file @file{dir}.  Likewise,
@kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual.
Dave Love's avatar
#  
Dave Love committed
857

858
  The node name @samp{*} specifies the whole file.  So you can look at
Dave Love's avatar
#  
Dave Love committed
859
all of the current file by typing @kbd{g*@key{RET}} or all of any
860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882
other file with @kbd{g(@var{filename})@key{RET}}.

@unnumberedsubsec @kbd{1} -- @kbd{9} choose a menu subtopic by its number

@kindex 1 @r{through} 9 @r{(Info mode)}
@findex Info-nth-menu-item
@cindex select @var{n}'th menu item
  If you begrudge each character of type-in which your system requires,
you might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4},
@dots{}, @kbd{9}.  They are short for the @kbd{m} command together
with a name of a menu subtopic.  @kbd{1} goes through the first item
in the current node's menu; @kbd{2} goes through the second item, etc.
In the stand-alone reader, @kbd{0} goes through the last menu item;
this is so you need not count how many entries are there.  In Emacs,
the digit keys run the command @code{Info-nth-menu-item}.

  If your display supports multiple fonts, and you are using Emacs'
Info mode to read Info files, the @samp{*} for the fifth menu item
stands out, either in color or in some other attribute, such as
underline, and so is the @samp{*} for the ninth item; this makes it
easy to see at a glance which number to use for an item.

  Some terminals don't support colors or underlining.  If you need to
Dave Love's avatar
#  
Dave Love committed
883
actually count items, it is better to use @kbd{m} instead, and specify
884
the name, or use @key{TAB} to quickly move between menu items.
Dave Love's avatar
#  
Dave Love committed
885

886 887 888 889 890 891
@unnumberedsubsec @kbd{e} makes Info document editable

@kindex e @r{(Info mode)}
@findex Info-edit
@cindex edit Info document
  The Info command @kbd{e} changes from Info mode to an ordinary
Dave Love's avatar
#  
Dave Love committed
892 893 894 895
Emacs editing mode, so that you can edit the text of the current node.
Type @kbd{C-c C-c} to switch back to Info.  The @kbd{e} command is allowed
only if the variable @code{Info-enable-edit} is non-@code{nil}.

896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977
  The @kbd{e} command only works in Emacs, where it runs the command
@code{Info-edit}.  The stand-alone Info reader doesn't allow you to
edit the Info file, so typing @kbd{e} there goes to the end of the
current node.

@node Info Search, Add, Expert, Advanced Info
@comment  node-name,  next,  previous,  up
@section How to search Info documents for specific subjects

@cindex searching Info documents
@cindex Info document as a reference
  The commands which move between and inside nodes allow you to read
the entire manual or its large portions.  But what if you need to find
some information in the manual as fast as you can, and you don't know
or don't remember in what node to look for it?  This need arises when
you use a manual as a @dfn{reference}, or when it is impractical to
read the entire manual before you start using the programs it
describes.

  Info has powerful searching facilities that let you find things
quickly.  You can search either the manual indices or its text.

@kindex i @r{(Info mode)}
@findex Info-index
  Since most subjects related to what the manual describes should be
indexed, you should try the index search first.  The @kbd{i} command
prompts you for a subject and then looks up that subject in the
indices.  If it finds an index entry with the subject you typed, it
goes to the node to which that index entry points.  You should browse
through that node to see whether the issue you are looking for is
described there.  If it isn't, type @kbd{,} one or more times to go
through additional index entries which match your subject.

  The @kbd{i} command finds all index entries which include the string
you typed @emph{as a substring}.  For each match, Info shows in the
echo area the full index entry it found.  Often, the text of the full
index entry already gives you enough information to decide whether it
is relevant to what you are looking for, so we recommend that you read
what Emacs shows in the echo are before looking at the node it
displays.

  Since @kbd{i} looks for a substring, you can search for subjects even
if you are not sure how they are spelled in the index.  For example,
suppose you want to find something that is pertinent to commands which
complete partial input (e.g., when you type @key{TAB}).  If you want
to catch index entries that refer to ``complete'', ``completion'', and
``completing'', you could type @kbd{icomplet@key{RET}}.

  Info documents which describe programs should index the commands,
options, and key sequences that the program provides.  If you are
looking for a description of a command, an option, or a key, just type
their names when @kbd{i} prompts you for a topic.  For example, if you
want to read the description of what the @kbd{C-f} key does, type
@kbd{iC-f@key{RET}}.  Here @kbd{C-f} are 3 literal characters
@samp{C}, @samp{-}, and @samp{f}, not the ``Control-f'' command key
you type inside Emacs to run the command bound to @kbd{C-f}.

  In Emacs, @kbd{i} runs the command @code{Info-index}.

@kindex s @r{(Info mode)}
@findex Info-search
  The @kbd{s} command allows you to search a whole file for a string.
It switches to the next node if and when that is necessary.  You
type @kbd{s} followed by the string to search for, terminated by
@key{RET}.  To search for the same string again, just @kbd{s} followed
by @key{RET} will do.  The file's nodes are scanned in the order
they are in in the file, which has no necessary relationship to the
order that they may be in the tree structure of menus and @samp{next}
pointers.  But normally the two orders are not very different.  In any
case, you can always do a @kbd{b} to find out what node you have
reached, if the header is not visible (this can happen, because @kbd{s}
puts your cursor at the occurrence of the string, not at the beginning
of the node).

@kindex M-s @r{(Info mode)}
  In Emacs, @kbd{Meta-s} is equivalent to @kbd{s}.  That is for
compatibility with other GNU packages that use @kbd{M-s} for a similar
kind of search command.  Both @kbd{s} and @kbd{M-s} run in Emacs the
command @code{Info-search}.


@node Add, Menus, Info Search, Advanced Info
Dave Love's avatar
#  
Dave Love committed
978 979 980 981
@comment  node-name,  next,  previous,  up
@section Adding a new node to Info

To add a new topic to the list in the Info directory, you must:
982

Dave Love's avatar
#  
Dave Love committed
983 984 985 986 987 988 989
@enumerate
@item
Create some nodes, in some file, to document that topic.
@item
Put that topic in the menu in the directory.  @xref{Menus, Menu}.
@end enumerate

990 991 992 993
  Usually, the way to create the nodes is with Texinfo (@pxref{Top,,
Overview of Texinfo, texinfo, Texinfo: The GNU Documentation Format});
this has the advantage that you can also make a printed manual from
them.  However, if you want to edit an Info file, here is how.
Dave Love's avatar
#  
Dave Love committed
994

995
@cindex node delimiters
Dave Love's avatar
#  
Dave Love committed
996 997 998
  The new node can live in an existing documentation file, or in a new
one.  It must have a @key{^_} character before it (invisible to the
user; this node has one but you cannot see it), and it ends with either
999
a @key{^_}, a @key{^L}, or the end of file.@footnote{If you put in a
Dave Love's avatar
#  
Dave Love committed
1000 1001 1002
@key{^L} to end a new node, be sure that there is a @key{^_} after it
to start the next one, since @key{^L} cannot @emph{start} a node.
Also, a nicer way to make a node boundary be a page boundary as well
1003
is to put a @key{^L} @emph{right after} the @key{^_}.}
Dave Love's avatar
#  
Dave Love committed
1004 1005

  The @key{^_} starting a node must be followed by a newline or a
1006 1007 1008 1009 1010 1011 1012 1013 1014 1015
@key{^L} newline, after which comes the node's header line.  The header
line must give the node's name (by which Info finds it), and state the
names of the @samp{Next}, @samp{Previous}, and @samp{Up} nodes (if there
are any).  As you can see, this node's @samp{Up} node is the node
@samp{Top}, which points at all the documentation for Info.  The
@samp{Next} node is @samp{Menus}.

@cindex node header line format
@cindex format of node headers
  The keywords @dfn{Node}, @dfn{Next}, @dfn{Previous}, and @dfn{Up}
Dave Love's avatar
#  
Dave Love committed
1016 1017 1018 1019 1020 1021 1022
may appear in any order, anywhere in the header line, but the
recommended order is the one in this sentence.  Each keyword must be
followed by a colon, spaces and tabs, and then the appropriate name.
The name may be terminated with a tab, a comma, or a newline.  A space
does not end it; node names may contain spaces.  The case of letters
in the names is insignificant.

1023 1024
@cindex node name format
@cindex Directory node
Dave Love's avatar
#  
Dave Love committed
1025 1026 1027 1028 1029
  A node name has two forms.  A node in the current file is named by
what appears after the @samp{Node: } in that node's first line.  For
example, this node's name is @samp{Add}.  A node in another file is
named by @samp{(@var{filename})@var{node-within-file}}, as in
@samp{(info)Add} for this node.  If the file name starts with ``./'',
1030 1031 1032 1033 1034 1035 1036 1037 1038
then it is relative to the current directory; otherwise, it is
relative starting from the standard directory for Info files of your
site.  The name @samp{(@var{filename})Top} can be abbreviated to just
@samp{(@var{filename})}.  By convention, the name @samp{Top} is used
for the ``highest'' node in any single file---the node whose @samp{Up}
points out of the file.  The @samp{Directory} node is @file{(dir)}, it
points to a file @file{dir} which holds a large menu listing all the
Info documents installed on your site.  The @samp{Top} node of a
document file listed in the @samp{Directory} should have an @samp{Up:
Dave Love's avatar
#  
Dave Love committed
1039 1040
(dir)} in it.

1041
@cindex unstructured documents
Dave Love's avatar
#  
Dave Love committed
1042 1043 1044 1045 1046 1047
  The node name @kbd{*} is special: it refers to the entire file.
Thus, @kbd{g*} shows you the whole current file.  The use of the
node @kbd{*} is to make it possible to make old-fashioned,
unstructured files into nodes of the tree.

  The @samp{Node:} name, in which a node states its own name, must not
1048 1049 1050 1051
contain a file name, since when Info searches for a node, it does not
expect a file name to be there.  The @samp{Next}, @samp{Previous} and
@samp{Up} names may contain them.  In this node, since the @samp{Up}
node is in the same file, it was not necessary to use one.
Dave Love's avatar
#  
Dave Love committed
1052 1053 1054 1055 1056 1057 1058 1059 1060

  Note that the nodes in this file have a file name in the header
line.  The file names are ignored by Info, but they serve as comments
to help identify the node for the user.

@node Menus, Cross-refs, Add, Advanced Info
@comment  node-name,  next,  previous,  up
@section How to Create Menus

1061
  Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
Dave Love's avatar
#  
Dave Love committed
1062 1063 1064
The @kbd{m} command searches the current node's menu for the topic which it
reads from the terminal.

1065
@cindex menu and menu entry format
Dave Love's avatar
#  
Dave Love committed
1066 1067
  A menu begins with a line starting with @samp{* Menu:}.  The rest of the
line is a comment.  After the starting line, every line that begins
1068 1069
with a @samp{* } lists a single topic.  The name of the topic--what
the user must type at the @kbd{m}'s command prompt to select this
Dave Love's avatar
#  
Dave Love committed
1070 1071 1072 1073 1074 1075 1076
topic---comes right after the star and space, and is followed by a
colon, spaces and tabs, and the name of the node which discusses that
topic.  The node name, like node names following @samp{Next}, @samp{Previous}
and @samp{Up}, may be terminated with a tab, comma, or newline; it may also
be terminated with a period.

  If the node name and topic name are the same, then rather than
1077 1078
giving the name twice, the abbreviation @samp{* @var{name}::} may be
used (and should be used, whenever possible, as it reduces the visual
Dave Love's avatar
#  
Dave Love committed
1079 1080 1081 1082 1083 1084 1085 1086
clutter in the menu).

  It is considerate to choose the topic names so that they differ
from each other very near the beginning---this allows the user to type
short abbreviations.  In a long menu, it is a good idea to capitalize
the beginning of each item name which is the minimum acceptable
abbreviation for it (a long menu is more than 5 or so entries).

1087 1088 1089 1090 1091
  The nodes listed in a node's menu are called its ``subnodes'', and it
is their ``superior''.  They should each have an @samp{Up:} pointing at
the superior.  It is often useful to arrange all or most of the subnodes
in a sequence of @samp{Next} and @samp{Previous} pointers so that
someone who wants to see them all need not keep revisiting the Menu.
Dave Love's avatar
#  
Dave Love committed
1092 1093 1094 1095 1096

  The Info Directory is simply the menu of the node @samp{(dir)Top}---that
is, node @samp{Top} in file @file{.../info/dir}.  You can put new entries
in that menu just like any other menu.  The Info Directory is @emph{not} the
same as the file directory called @file{info}.  It happens that many of
1097 1098
Info's files live in that file directory, but they do not have to; and
files in that directory are not automatically listed in the Info
Dave Love's avatar
#  
Dave Love committed
1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116
Directory node.

  Also, although the Info node graph is claimed to be a ``hierarchy'',
in fact it can be @emph{any} directed graph.  Shared structures and
pointer cycles are perfectly possible, and can be used if they are
appropriate to the meaning to be expressed.  There is no need for all
the nodes in a file to form a connected structure.  In fact, this file
has two connected components.  You are in one of them, which is under
the node @samp{Top}; the other contains the node @samp{Help} which the
@kbd{h} command goes to.  In fact, since there is no garbage
collector, nothing terrible happens if a substructure is not pointed
to, but such a substructure is rather useless since nobody can
ever find out that it exists.

@node Cross-refs, Tags, Menus, Advanced Info
@comment  node-name,  next,  previous,  up
@section Creating Cross References

1117
@cindex cross reference format
Dave Love's avatar
#  
Dave Love committed
1118 1119
  A cross reference can be placed anywhere in the text, unlike a menu
item which must go at the front of a line.  A cross reference looks
1120
like a menu item except that it has @samp{*note} instead of @samp{*}.
Dave Love's avatar
#  
Dave Love committed
1121 1122 1123 1124 1125 1126 1127 1128 1129
It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are
so often part of node names.  If you wish to enclose a cross reference
in parentheses, terminate it with a period first.  Here are two
examples of cross references pointers:

@example
*Note details: commands.  (See *note 3: Full Proof.)
@end example

1130 1131 1132
@noindent
@emph{These are just examples.}  The places they ``lead to'' do not
really exist!
Dave Love's avatar
#  
Dave Love committed
1133 1134 1135 1136 1137

@node Tags, Checking, Cross-refs, Advanced Info
@comment  node-name,  next,  previous,  up
@section Tags Tables for Info Files

1138
@cindex tags tables in info files
Dave Love's avatar
#  
Dave Love committed
1139 1140
  You can speed up the access to nodes of a large Info file by giving
it a tags table.  Unlike the tags table for a program, the tags table for
1141
an Info file lives inside the file itself and is used
Dave Love's avatar
#  
Dave Love committed
1142 1143
automatically whenever Info reads in the file.

1144
@findex Info-tagify
Dave Love's avatar
#  
Dave Love committed
1145 1146
  To make a tags table, go to a node in the file using Emacs Info mode and type
@kbd{M-x Info-tagify}.  Then you must use @kbd{C-x C-s} to save the
1147 1148
file.  Info files produced by the @code{makeinfo} command that is part
of the Texinfo package always have tags tables to begin with.
Dave Love's avatar
#  
Dave Love committed
1149

1150 1151
@cindex stale tags tables
@cindex update Info tags table
Dave Love's avatar
#  
Dave Love committed
1152
  Once the Info file has a tags table, you must make certain it is up
1153 1154
to date.  If you edit an Info file directly (as opposed to editing its
Texinfo source), and, as a result of deletion of text, any node moves back
Dave Love's avatar
#  
Dave Love committed
1155 1156
more than a thousand characters in the file from the position
recorded in the tags table, Info will no longer be able to find that
1157 1158
node.  To update the tags table, use the @code{Info-tagify} command
again.
Dave Love's avatar
#  
Dave Love committed
1159 1160 1161 1162 1163

  An Info file tags table appears at the end of the file and looks like
this:

@example
1164
^_^L
Dave Love's avatar
#  
Dave Love committed
1165 1166 1167 1168 1169 1170 1171 1172 1173 1174
Tag Table:
File: info, Node: Cross-refs^?21419
File: info,  Node: Tags^?22145
^_
End Tag Table
@end example

@noindent
Note that it contains one line per node, and this line contains
the beginning of the node's header (ending just after the node name),
1175
a DEL character, and the character position in the file of the
Dave Love's avatar
#  
Dave Love committed
1176 1177
beginning of the node.

1178

Dave Love's avatar
#  
Dave Love committed
1179 1180 1181
@node Checking, Emacs Info Variables, Tags, Advanced Info
@section Checking an Info File

1182 1183 1184 1185 1186 1187
When creating an Info file, it is easy to forget the name of a node when
you are making a pointer to it from another node.  If you put in the
wrong name for a node, this is not detected until someone tries to go
through the pointer using Info.  Verification of the Info file is an
automatic process which checks all pointers to nodes and reports any
pointers which are invalid.  Every @samp{Next}, @samp{Previous}, and
Dave Love's avatar
#  
Dave Love committed
1188
@samp{Up} is checked, as is every menu item and every cross reference.  In
1189 1190 1191 1192
addition, any @samp{Next} which does not have a @samp{Previous} pointing
back is reported.  Only pointers within the file are checked, because
checking pointers to other files would be terribly slow.  But those are
usually few.
Dave Love's avatar
#  
Dave Love committed
1193

1194 1195 1196
@findex Info-validate
To check an Info file, do @kbd{M-x Info-validate} while looking at any
node of the file with Emacs Info mode.
Dave Love's avatar
#  
Dave Love committed
1197 1198 1199 1200

@node Emacs Info Variables, , Checking, Advanced Info
@section Emacs Info-mode Variables

1201
The following variables may modify the behavior of Info-mode in Emacs;
Dave Love's avatar
#  
Dave Love committed
1202 1203 1204
you may wish to set one or several of these variables interactively, or
in your @file{~/.emacs} init file.  @xref{Examining, Examining and Setting
Variables, Examining and Setting Variables, emacs, The GNU Emacs
1205 1206 1207
Manual}.  The stand-alone Info reader program has its own set of
variables, described in @ref{Variables,, Manipulating Variables,
info-stnd, GNU Info}.
Dave Love's avatar
#  
Dave Love committed
1208

1209
@vtable @code
Dave Love's avatar
#  
Dave Love committed
1210 1211
@item Info-directory-list
The list of directories to search for Info files.  Each element is a
Gerd Moellmann's avatar
Gerd Moellmann committed
1212 1213 1214 1215 1216 1217 1218 1219
string (directory name) or @code{nil} (try default directory).  If not
initialized Info uses the environment variable @env{INFOPATH} to
initialize it, or @code{Info-default-directory-list} if there is no
@env{INFOPATH} variable in the environment.

@item Info-additional-directory-list
A list of additional directories to search for Info documentation files.
These directories are not searched for merging the @file{dir} file.
Dave Love's avatar
#  
Dave Love committed
1220

1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245
@item Info-fontify
When set to a non-@code{nil} value, enables highlighting of Info
files.  The default is @code{t}.  You can change how the highlighting
looks by customizing the faces @code{info-node}, @code{info-menu-5},
@code{info-xref}, @code{info-header-xref}, @code{info-header-node},
@code{info-title-@var{n}-face} (where @var{n} is the level of the
section, a number between 1 and 4), and @code{info-menu-header}.  To
customize a face, type @kbd{M-x customize-face @key{RET} @var{face}
@key{RET}}, where @var{face} is one of the face names listed here.

@item Info-use-header-line
If non-@code{nil}, Emacs puts in the Info buffer a header line showing
the @samp{Next}, @samp{Prev}, and @samp{Up} links.  A header line does
not scroll with the rest of the buffer, making these links always
visible.

@item Info-scroll-prefer-subnodes
If set to a non-@code{nil} value, Space and Backspace (or DEL) keys in
a menu visit subnodes of the current node before scrolling to its end
or beginning, respectively.  For example, if the node's menu appears
on the screen, the next Space moves to a subnode indicated by the
following menu item.  Setting this option to @code{nil} results in
behavior similar to the stand-alone Info reader program, which visits
the first subnode from the menu only when you hit the end of the
current node.  The default is @code{t}.
Gerd Moellmann's avatar
Gerd Moellmann committed
1246

1247 1248 1249 1250 1251
@item Info-enable-active-nodes
When set to a non-@code{nil} value, allows Info to execute Lisp code
associated with nodes.  The Lisp code is executed when the node is
selected.  The Lisp code to be executed should follow the node
delimiter (the DEL character) and an @samp{execute: } tag, like this:
Dave Love's avatar
#  
Dave Love committed
1252

1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264
@example
^_execute: (message "This is an active node!")
@end example

@item Info-enable-edit
Set to @code{nil}, disables the @samp{e} (@code{Info-edit}) command.  A
non-@code{nil} value enables it.  @xref{Add, Edit}.
@end vtable


@node Creating an Info File
@chapter Creating an Info File from a Texinfo File
Dave Love's avatar
#  
Dave Love committed
1265 1266 1267 1268 1269

@code{makeinfo} is a utility that converts a Texinfo file into an Info
file; @code{texinfo-format-region} and @code{texinfo-format-buffer} are
GNU Emacs functions that do the same.

1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284
@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU
Documentation Format}, to learn how to write a Texinfo file.

@xref{Creating an Info File,,, texinfo, Texinfo: The GNU Documentation
Format}, to learn how to create an Info file from a Texinfo file.

@xref{Installing an Info File,,, texinfo, Texinfo: The GNU
Documentation Format}, to learn how to install an Info file after you
have created one.

@node Index
@unnumbered Index

This is an alphabetical listing of all the commands, variables, and
topics discussed in this document.
Dave Love's avatar
#  
Dave Love committed
1285

1286
@printindex cp
Dave Love's avatar
#  
Dave Love committed
1287 1288

@bye