Merge from emacs-24; up to 2012-11-09T14:45:15Z!dmantipov@yandex.ru
[bpt/emacs.git] / doc / misc / info.texi
CommitLineData
4009494e
GM
1\input texinfo.tex @c -*-texinfo-*-
2@c We must \input texinfo.tex instead of texinfo, otherwise make
3@c distcheck in the Texinfo distribution fails, because the texinfo Info
4@c file is made first, and texi2dvi must include . first in the path.
5@comment %**start of header
6@setfilename info.info
7@settitle Info
8@syncodeindex fn cp
9@syncodeindex vr cp
10@syncodeindex ky cp
11@comment %**end of header
12
13@copying
14This file describes how to use Info, the on-line, menu-driven GNU
15documentation system.
16
44e97401 17Copyright @copyright{} 1989, 1992, 1996-2012 Free Software Foundation, Inc.
4009494e
GM
18
19@quotation
20Permission is granted to copy, distribute and/or modify this document
6a2c4aec 21under the terms of the GNU Free Documentation License, Version 1.3 or
4009494e
GM
22any later version published by the Free Software Foundation; with no
23Invariant Sections, with the Front-Cover texts being ``A GNU
24Manual,'' and with the Back-Cover Texts as in (a) below. A copy of the
25license is included in the section entitled ``GNU Free Documentation
26License'' in the Emacs manual.
27
6f093307
GM
28(a) The FSF's Back-Cover Text is: ``You have the freedom to copy and
29modify this GNU manual. Buying copies from the FSF supports it in
30developing GNU and promoting software freedom.''
4009494e
GM
31
32This document is part of a collection distributed under the GNU Free
33Documentation License. If you want to distribute this document
34separately from the collection, you can do so by adding a copy of the
35license to the document, as described in section 6 of the license.
36@end quotation
37@end copying
38
39@dircategory Texinfo documentation system
40@direntry
62e034c2 41* Info: (info). How to use the documentation browsing system.
4009494e
GM
42@end direntry
43
44@titlepage
45@title Info
46@subtitle The online, hyper-text GNU documentation system
47@author Brian Fox
48@author and the GNU Texinfo community
49@page
50@vskip 0pt plus 1filll
51@insertcopying
52@end titlepage
53
54@contents
55
56@ifnottex
57@node Top
58@top Info: An Introduction
59
60The GNU Project distributes most of its on-line manuals in the
61@dfn{Info format}, which you read using an @dfn{Info reader}. You are
62probably using an Info reader to read this now.
63
64There are two primary Info readers: @code{info}, a stand-alone program
149a3837 65designed just to read Info files (@pxref{Top,,What is Info?,
0549d8fc 66info-stnd, GNU Info}), and the @code{info} package in GNU Emacs, a
149a3837
KB
67general-purpose editor. At present, only the Emacs reader supports
68using a mouse.
4009494e
GM
69
70@ifinfo
71If you are new to the Info reader and want to learn how to use it,
72type the command @kbd{h} now. It brings you to a programmed
73instruction sequence.
74
75To read about advanced Info commands, type @kbd{n} twice. This
76brings you to @cite{Advanced Info Commands}, skipping over the `Getting
77Started' chapter.
78@end ifinfo
79@end ifnottex
80
5dc584b5
KB
81@insertcopying
82
4009494e
GM
83@menu
84* Getting Started:: Getting started using an Info reader.
85* Advanced:: Advanced Info commands.
86* Expert Info:: Info commands for experts.
87* Index:: An index of topics, commands, and variables.
88@end menu
89
90@node Getting Started, Advanced, Top, Top
91@comment node-name, next, previous, up
92@chapter Getting Started
93
94This first part of this Info manual describes how to get around inside
95of Info. The second part of the manual describes various advanced
96Info commands. The third part briefly explains how to generate Info
97files from Texinfo files, and describes how to write an Info file
98by hand.
99
100@ifnotinfo
101This manual is primarily designed for browsing with an Info reader
102program on a computer, so that you can try Info commands while reading
103about them. Reading it on paper or with an HTML browser is less
104effective, since you must take it on faith that the commands described
105really do what the manual says. By all means go through this manual
106now that you have it; but please try going through the on-line version
107as well.
108
109@cindex Info reader, how to invoke
110@cindex entering Info
111There are two ways of looking at the online version of this manual:
112
113@enumerate
114@item
115Type @code{info} at your shell's command line. This approach uses a
116stand-alone program designed just to read Info files.
117
118@item
119Type @code{emacs} at the command line; then type @kbd{C-h i}
120(@kbd{Control-h}, followed by @kbd{i}). This approach uses the Info
121mode of the Emacs editor.
122@end enumerate
123
124In either case, then type @kbd{mInfo} (just the letters), followed by
125@key{RET}---the ``Return'' or ``Enter'' key. At this point, you should
126be ready to follow the instructions in this manual as you read them on
127the screen.
128@c FIXME! (pesch@cygnus.com, 14 dec 1992)
129@c Is it worth worrying about what-if the beginner goes to somebody
130@c else's Emacs session, which already has an Info running in the middle
131@c of something---in which case these simple instructions won't work?
132@end ifnotinfo
133
134@menu
135* Help-Small-Screen:: Starting Info on a Small Screen.
136* Help:: How to use Info.
137* Help-P:: Returning to the Previous node.
138* Help-^L:: The Space, DEL, B and ^L commands.
139* Help-Inv:: Invisible text in Emacs Info.
140* Help-M:: Menus.
141* Help-Xref:: Following cross-references.
142* Help-Int:: Some intermediate Info commands.
143* Help-Q:: Quitting Info.
144@end menu
145
146@node Help-Small-Screen
147@section Starting Info on a Small Screen
148
149@ifnotinfo
150(In Info, you only see this section if your terminal has a small
151number of lines; most readers pass by it without seeing it.)
152@end ifnotinfo
153
154@cindex small screen, moving around
155Since your terminal has a relatively small number of lines on its
156screen, it is necessary to give you special advice at the beginning.
157
158If the entire text you are looking at fits on the screen, the text
159@samp{All} will be displayed at the bottom of the screen. In the
160stand-alone Info reader, it is displayed at the bottom right corner of
161the screen; in Emacs, it is displayed on the modeline. If you see the
162text @samp{Top} instead, it means that there is more text below that
163does not fit. To move forward through the text and see another screen
164full, press @key{SPC}, the Space bar. To move back up, press the key
165labeled @samp{Backspace} or @samp{DEL} (on some keyboards, this key
166might be labeled @samp{Delete}).
167
168@ifinfo
169Here are 40 lines of junk, so you can try @key{SPC} and @key{DEL} and
170see what they do. At the end are instructions of what you should do
171next.
172
173@format
174This is line 20
175This is line 21
176This is line 22
177This is line 23
178This is line 24
179This is line 25
180This is line 26
181This is line 27
182This is line 28
183This is line 29
184This is line 30
185This is line 31
186This is line 32
187This is line 33
188This is line 34
189This is line 35
190This is line 36
191This is line 37
192This is line 38
193This is line 39
194This is line 40
195This is line 41
196This is line 42
197This is line 43
198This is line 44
199This is line 45
200This is line 46
201This is line 47
202This is line 48
203This is line 49
204This is line 50
205This is line 51
206This is line 52
207This is line 53
208This is line 54
209This is line 55
210This is line 56
211This is line 57
212This is line 58
213This is line 59
214@end format
215
216If you have managed to get here, go back to the beginning with
217@kbd{DEL} (or @key{BACKSPACE}), and come back here again, then you
218understand the about the @samp{Space} and @samp{Backspace} keys. So
219now type an @kbd{n}---just one character; don't type the quotes and
220don't type the Return key afterward---to get to the normal start of
221the course.
222@end ifinfo
223
224@node Help, Help-P, Help-Small-Screen, Getting Started
225@comment node-name, next, previous, up
226@section How to use Info
227
228You are talking to the program Info, for reading documentation.
229
230 There are two ways to use Info: from within Emacs or as a
231stand-alone reader that you can invoke from a shell using the command
232@command{info}.
233
234@cindex node, in Info documents
235 Right now you are looking at one @dfn{Node} of Information.
236A node contains text describing a specific topic at a specific
237level of detail. This node's topic is ``how to use Info''. The mode
238line says that this is node @samp{Help} in the file @file{info}.
239
240@cindex header of Info node
241 The top line of a node is its @dfn{header}. This node's header
242(look at it now) says that the @samp{Next} node after this one is the
243node called @samp{Help-P}. An advanced Info command lets you go to
244any node whose name you know. In the stand-alone Info reader program,
245the header line shows the names of this node and the Info file as
246well. In Emacs, the header line is displayed with a special typeface,
247and remains at the top of the window all the time even if you scroll
248through the node.
249
250 Besides a @samp{Next}, a node can have a @samp{Previous} link, or an
251@samp{Up} link, or both. As you can see, this node has all of these
252links.
253
254@kindex n @r{(Info mode)}
255 Now it is time to move on to the @samp{Next} node, named @samp{Help-P}.
256
257@format
258>> Type @kbd{n} to move there. Type just one character;
259 do not type the quotes and do not type a @key{RET} afterward.
260@end format
261
262@noindent
263@samp{>>} in the margin means it is really time to try a command.
264
265@format
266>> If you are in Emacs and have a mouse, and if you already practiced
267 typing @kbd{n} to get to the next node, click now with the left
268 mouse button on the @samp{Next} link to do the same ``the mouse way''.
269@end format
270
271@node Help-P, Help-^L, Help, Getting Started
272@comment node-name, next, previous, up
273@section Returning to the Previous node
274
275@kindex p @r{(Info mode)}
276This node is called @samp{Help-P}. The @samp{Previous} node, as you see,
277is @samp{Help}, which is the one you just came from using the @kbd{n}
278command. Another @kbd{n} command now would take you to the next
279node, @samp{Help-^L}.
280
281@format
282>> But do not type @kbd{n} yet. First, try the @kbd{p} command, or
283 (in Emacs) click on the @samp{Prev} link. That takes you to
284 the @samp{Previous} node. Then use @kbd{n} to return here.
285@end format
286
287 If you read this in Emacs, you will see an @samp{Info} item in the
288menu bar, close to its right edge. Clicking the mouse on the
289@samp{Info} menu-bar item opens a menu of commands which include
290@samp{Next} and @samp{Previous} (and also some others which you didn't yet
291learn about).
292
293 This all probably seems insultingly simple so far, but @emph{please
294don't} start skimming. Things will get complicated soon enough!
295Also, please do not try a new command until you are told it is time
296to. You could make Info skip past an important warning that was
297coming up.
298
299@format
300>> Now do an @kbd{n}, or (in Emacs) click the middle mouse button on
301 the @samp{Next} link, to get to the node @samp{Help-^L} and learn more.
302@end format
303
304@node Help-^L, Help-Inv, Help-P, Getting Started
305@comment node-name, next, previous, up
306@section The Space, DEL, B and ^L commands
307
308 This node's mode line tells you that you are now at node
309@samp{Help-^L}, and the header line tells you that @kbd{p} would get
310you back to @samp{Help-P}. The node's title is highlighted and may be
311underlined as well; it says what the node is about.
312
313 This is a big node and it does not all fit on your display screen.
314You can tell that there is more that is not visible because you
315can see the text @samp{Top} rather than @samp{All} near the bottom of
316the screen.
317
318@kindex SPC @r{(Info mode)}
319@kindex DEL @r{(Info mode)}
320@kindex BACKSPACE @r{(Info mode)}
321@findex Info-scroll-up
322@findex Info-scroll-down
323 The @key{SPC}, @key{BACKSPACE} (or @key{DEL})@footnote{The key which
324we call ``Backspace or DEL'' in this manual is labeled differently on
325different keyboards. Look for a key which is a little ways above the
326@key{ENTER} or @key{RET} key and which you normally use outside Emacs
327to erase the character before the cursor, i.e.@: the character you
328typed last. It might be labeled @samp{Backspace} or @samp{<-} or
329@samp{DEL}, or sometimes @samp{Delete}.} and @kbd{b} commands exist to
330allow you to ``move around'' in a node that does not all fit on the
331screen at once. @key{SPC} moves forward, to show what was below the
332bottom of the screen. @key{DEL} or @key{BACKSPACE} moves backward, to
333show what was above the top of the screen (there is not anything above
334the top until you have typed some spaces).
335
336@format
337>> Now try typing a @key{SPC} (afterward, type a @key{BACKSPACE} to
338 return here).
339@end format
340
341 When you type the @key{SPC}, the two lines that were at the bottom of
342the screen appear at the top, followed by more lines. @key{DEL} or
343@key{BACKSPACE} takes the two lines from the top and moves them to the
344bottom, @emph{usually}, but if there are not a full screen's worth of
345lines above them they may not make it all the way to the bottom.
346
347 If you are reading this in Emacs, note that the header line is
348always visible, never scrolling off the display. That way, you can
349always see the @samp{Next}, @samp{Prev}, and @samp{Up} links, and you
350can conveniently go to one of these links at any time by
351clicking the middle mouse button on the link.
352
353@cindex reading Info documents top to bottom
354@cindex Info documents as tutorials
355 @key{SPC} and @key{DEL} not only move forward and backward through
356the current node. They also move between nodes. @key{SPC} at the end
357of a node moves to the next node; @key{DEL} (or @key{BACKSPACE}) at
358the beginning of a node moves to the previous node. In effect, these
359commands scroll through all the nodes in an Info file as a single
360logical sequence. You can read an entire manual top to bottom by just
361typing @key{SPC}, and move backward through the entire manual from
362bottom to top by typing @key{DEL} (or @key{BACKSPACE}).
363
364 In this sequence, a node's subnodes appear following their parent.
365If a node has a menu, @key{SPC} takes you into the subnodes listed in
366the menu, one by one. Once you reach the end of a node, and have seen
367all of its subnodes, @key{SPC} takes you to the next node or to the
368parent's next node.
369
370@kindex PAGEUP @r{(Info mode)}
371@kindex PAGEDOWN @r{(Info mode)}
372 Many keyboards nowadays have two scroll keys labeled @samp{PageUp}
373and @samp{PageDown} (or maybe @samp{Prior} and @samp{Next}). If your
374keyboard has these keys, you can use them to move forward and backward
375through the text of one node, like @key{SPC} and @key{BACKSPACE} (or
376@key{DEL}). However, @key{PAGEUP} and @key{PAGEDOWN} keys never
377scroll beyond the beginning or the end of the current node.
378
379@kindex C-l @r{(Info mode)}
380 If your screen is ever garbaged, you can tell Info to display it
381again by typing @kbd{C-l} (@kbd{Control-L}---that is, hold down
382@key{CTRL} and type @kbd{L} or @kbd{l}).
383
384@format
385>> Type @kbd{C-l} now.
386@end format
387
388@kindex b @r{(Info mode)}
389 To move back to the beginning of the node you are on, you can type
390the @key{BACKSPACE} key (or @key{DEL}) many times. You can also type
391@kbd{b} just once. @kbd{b} stands for ``beginning.''
392
393@format
394>> Try that now. (We have put in enough verbiage to push this past
395 the first screenful, but screens are so big nowadays that perhaps it
396 isn't enough. You may need to shrink your Emacs or Info window.)
397 Then come back, by typing @key{SPC} one or more times.
398@end format
399
400@kindex ? @r{(Info mode)}
401@findex Info-summary
402 You have just learned a considerable number of commands. If you
403want to use one but have trouble remembering which, you should type
404@kbd{?}, which displays a brief list of commands. When you are
405finished looking at the list, make it go away by typing @key{SPC}
406repeatedly.
407
408@format
409>> Type a @key{?} now. Press @key{SPC} to see consecutive screenfuls of
410 the list until finished. Then type @key{SPC} several times. If
411 you are using Emacs, the help will then go away automatically.
412@end format
413
414 (If you are using the stand-alone Info reader, type @kbd{C-x 0} to
415return here, that is---press and hold @key{CTRL}, type an @kbd{x},
416then release @key{CTRL} and @kbd{x}, and press @kbd{0}; that's a zero,
417not the letter ``o''.)
418
419 From now on, you will encounter large nodes without warning, and
420will be expected to know how to use @key{SPC} and @key{BACKSPACE} to
421move around in them without being told. Since not all terminals have
422the same size screen, it would be impossible to warn you anyway.
423
424@format
425>> Now type @kbd{n}, or click the middle mouse button on the @samp{Next} link,
426 to visit the next node.
427@end format
428
429@node Help-Inv, Help-M, Help-^L, Getting Started
430@comment node-name, next, previous, up
431@section Invisible text in Emacs Info
432
433 Before discussing menus, we need to make some remarks that are only
434relevant to users reading Info using Emacs. Users of the stand-alone
435version can skip this node by typing @kbd{]} now.
436
437@cindex invisible text in Emacs
438 In Emacs, certain text that appears in the stand-alone version is
439normally hidden, technically because it has the @samp{invisibility}
440property. Invisible text is really a part of the text. It becomes
441visible (by default) after killing and yanking, it appears in printed
442output, it gets saved to file just like any other text, and so on.
443Thus it is useful to know it is there.
444
445@findex visible-mode
446You can make invisible text visible by using the command @kbd{M-x
447visible-mode}. Visible mode is a minor mode, so using the command a
448second time will make the text invisible again. Watch the effects of
449the command on the ``menu'' below and the top line of this node.
450
451If you prefer to @emph{always} see the invisible text, you can set
452@code{Info-hide-note-references} to @code{nil}. Enabling Visible mode
453permanently is not a real alternative, because Emacs Info also uses
454(although less extensively) another text property that can change the
455text being displayed, the @samp{display} property. Only the
456invisibility property is affected by Visible mode. When, in this
457tutorial, we refer to the @samp{Emacs} behavior, we mean the
458@emph{default} Emacs behavior.
459
460Now type @kbd{]}, to learn about the @kbd{]} and @kbd{[} commands.
461
462@menu
463* ]: Help-]. Node telling about ].
464* stuff: Help-]. Same node.
465* Help-]:: Yet again, same node.
466@end menu
467
468@node Help-], , , Help-Inv
469@subsection The @kbd{]} and @kbd{[} commands
470
471If you type @kbd{n} now, you get an error message saying that this
472node has no next node. Similarly, if you type @kbd{p}, the error
473message tells you that there is no previous node. (The exact message
474depends on the Info reader you use.) This is because @kbd{n} and
475@kbd{p} carry you to the next and previous node @emph{at the same
476level}. The present node is contained in a menu (see next) of the
477node you came from, and hence is considered to be at a lower level.
478It is the only node in the previous node's menu (even though it was
479listed three times). Hence it has no next or previous node that
480@kbd{n} or @kbd{p} could move to.
481
482If you systematically move through a manual by typing @kbd{n}, you run
483the risk of skipping many nodes. You do not run this risk if you
484systematically use @kbd{@key{SPC}}, because, when you scroll to the
485bottom of a node and type another @kbd{@key{SPC}}, then this carries
486you to the following node in the manual @emph{regardless of level}.
487If you immediately want to go to that node, without having to scroll
488to the bottom of the screen first, you can type @kbd{]}.
489
490Similarly, @kbd{@key{BACKSPACE}} carries you to the preceding node
491regardless of level, after you scrolled to the beginning of the
492present node. If you want to go to the preceding node immediately,
493you can type @kbd{[}.
494
495For instance, typing this sequence will come back here in three steps:
496@kbd{[ n [}. To do the same backward, type @kbd{] p ]}.
497
498Now type @kbd{]} to go to the next node and learn about menus.
499
500@node Help-M, Help-Xref, Help-Inv, Getting Started
501@comment node-name, next, previous, up
502@section Menus and the @kbd{m} command
503
504@cindex menus in an Info document
505@cindex Info menus
506 With only the @kbd{n} (next), @kbd{p} (previous), @kbd{@key{SPC}},
507@kbd{@key{BACKSPACE}}, @kbd{]} and @kbd{[} commands for moving between
508nodes, nodes are restricted to a linear sequence. Menus allow a
509branching structure. A menu is a list of other nodes you can move to.
510It is actually just part of the text of the node formatted specially
511so that Info can interpret it. The beginning of a menu is always
512identified by a line which starts with @w{@samp{* Menu:}}. A node
513contains a menu if and only if it has a line in it which starts that
514way. The only menu you can use at any moment is the one in the node
515you are in. To use a menu in any other node, you must move to that
516node first.
517
518 After the start of the menu, each line that starts with a @samp{*}
519identifies one subtopic. The line usually contains a brief name for
520the subtopic (followed by a @samp{:}, normally hidden in Emacs), the
521name of the node that talks about that subtopic (again, normally
522hidden in Emacs), and optionally some further description of the
523subtopic. Lines in the menu that do not start with a @samp{*} have no
524special meaning---they are only for the human reader's benefit and do
525not define additional subtopics. Here is an example:
526
527@example
528* Foo: Node about FOO. This tells about FOO.
529@end example
530
531The subtopic name is Foo, and the node describing it is @samp{Node
532about FOO}. The rest of the line is just for the reader's
533Information. [[ But this line is not a real menu item, simply because
534there is no line above it which starts with @w{@samp{* Menu:}}. Also,
535in a real menu item, the @samp{*} would appear at the very start of
536the line. This is why the ``normally hidden'' text in Emacs, namely
537@samp{: Node about FOO.}, is actually visible in this example, even
538when Visible mode is off.]]
539
540 When you use a menu to go to another node (in a way that will be
541described soon), what you specify is the subtopic name, the first
542thing in the menu line. Info uses it to find the menu line, extracts
543the node name from it, and goes to that node. The reason that there
544is both a subtopic name and a node name is that the node name must be
545meaningful to the computer and may therefore have to be ugly looking.
546The subtopic name can be chosen just to be convenient for the user to
547specify. Often the node name is convenient for the user to specify
548and so both it and the subtopic name are the same. There is an
549abbreviation for this:
550
551@example
552* Foo:: This tells about FOO.
553@end example
554
555@noindent
556This means that the subtopic name and node name are the same; they are
557both @samp{Foo}. (The @samp{::} is normally hidden in Emacs.)
558
559@format
560>> Now use @key{SPC} to find the menu in this node, then come back to
561 the front with a @kbd{b} and some @key{SPC}s. As you see, a menu is
562 actually visible in its node. If you cannot find a menu in a node
563 by looking at it, then the node does not have a menu and the
564 @kbd{m} command is not available.
565@end format
566
567If you keep typing @key{SPC} once the menu appears on the screen, it
568will move to another node (the first one in the menu). If that
569happens, type @key{BACKSPACE} to come back.
570
571@kindex m @r{(Info mode)}
572 The command to go to one of the subnodes is @kbd{m}. This is very
573different from the commands you have used: it is a command that
574prompts you for more input.
575
576 The Info commands you know do not need additional input; when you
577type one of them, Info processes it instantly and then is ready for
578another command. The @kbd{m} command is different: it needs to know
579the @dfn{name of the subtopic}. Once you have typed @kbd{m}, Info
580tries to read the subtopic name.
581
582 Now, in the stand-alone Info, look for the line containing many
583dashes near the bottom of the screen. (This is the stand-alone
584equivalent for the mode line in Emacs.) There is one more line
585beneath that one, but usually it is blank. (In Emacs, this is the
586echo area.) When it is blank, Info is ready for a command, such as
587@kbd{n} or @kbd{b} or @key{SPC} or @kbd{m}. If that line contains
588text ending in a colon, it means Info is reading more input for the
589last command. You can't type an Info command then, because Info is
590trying to read input, not commands. You must either give the input
591and finish the command you started, or type @kbd{Control-g} to cancel
592the command. When you have done one of those things, the input entry
593line becomes blank again. Then you can type Info commands again.
594
595@findex Info-menu
596 The command to go to a subnode via a menu is @kbd{m}. After you type
597the @kbd{m}, the line at the bottom of the screen says @samp{Menu item: }.
598You must then type the name of the subtopic you want, and end it with
599a @key{RET}.
600
601@cindex abbreviating Info subnodes
602 You can abbreviate the subtopic name. If the abbreviation is not
603unique, the first matching subtopic is chosen. Some menus put
604the shortest possible abbreviation for each subtopic name in capital
605letters, so you can see how much you need to type. It does not
606matter whether you use upper case or lower case when you type the
607subtopic. You should not put any spaces at the end, or inside of the
608item name, except for one space where a space appears in the item in
609the menu.
610
611@cindex completion of Info node names
612 You can also use the @dfn{completion} feature to help enter the
613subtopic name. If you type the @key{TAB} key after entering part of a
614name, it will fill in more of the name---as much as Info can deduce
615from the part you have entered.
616
617 If you move the cursor to one of the menu subtopic lines, then you do
618not need to type the argument: you just type a @key{RET}, and it
619stands for the subtopic of the line you are on. You can also click
620the middle mouse button directly on the subtopic line to go there.
621
622Here is a menu to give you a chance to practice. This menu gives you
623three ways of going to one place, Help-FOO:
624
625@menu
626* Foo: Help-FOO. A node you can visit for fun.
627* Bar: Help-FOO. We have made two ways to get to the same place.
628* Help-FOO:: And yet another!
629@end menu
630
631(Turn Visible mode on if you are using Emacs.)
632
633@format
634>> Now type just an @kbd{m} and see what happens:
635@end format
636
637 Now you are ``inside'' an @kbd{m} command. Commands cannot be used
638now; the next thing you will type must be the name of a subtopic.
639
640 You can change your mind about doing the @kbd{m} by typing
641@kbd{Control-g}.
642
643@format
644>> Try that now; notice the bottom line clear.
645@end format
646
647@format
648>> Then type another @kbd{m}.
649@end format
650
651@format
652>> Now type @kbd{BAR}, the item name. Do not type @key{RET} yet.
653@end format
654
655 While you are typing the item name, you can use the @key{DEL} (or
656@key{BACKSPACE}) key to cancel one character at a time if you make a
657mistake.
658
659@format
660>> Press @key{DEL} to cancel the @samp{R}. You could type another @kbd{R}
661 to replace it. But you do not have to, since @samp{BA} is a valid
662 abbreviation.
663@end format
664
665@format
666>> Now you are ready to go. Type a @key{RET}.
667@end format
668
669 After visiting @samp{Help-FOO}, you should return here.
670
671 Another way to move to the menu subtopic lines and between them is
672to type @key{TAB}. Each time you type a @key{TAB}, you move to the
673next subtopic line. To move to a previous subtopic line in the
674stand-alone reader, type @kbd{M-@key{TAB}}---that is, press and hold
675the @key{META} key and then press @key{TAB}. (On some keyboards, the
676@key{META} key might be labeled @samp{Alt}.) In Emacs Info, type
677@kbd{S-@key{TAB}} to move to a previous subtopic line (press and hold
678the @key{Shift} key and then press @key{TAB}).
679
680 Once you move cursor to a subtopic line, press @key{RET} to go to
681that subtopic's node.
682
683@cindex mouse support in Info mode
684@kindex Mouse-2 @r{(Info mode)}
685 If your terminal supports a mouse, you have yet another way of going
686to a subtopic. Move your mouse pointer to the subtopic line,
687somewhere between the beginning @samp{*} and the colon @samp{:} which
688ends the subtopic's brief name. You will see the subtopic's name
689change its appearance (usually, its background color will change), and
690the shape of the mouse pointer will change if your platform supports
691that. After a while, if you leave the mouse on that spot, a small
692window will pop up, saying ``Mouse-2: go to that node,'' or the same
693message may appear at the bottom of the screen.
694
695 @kbd{Mouse-2} is the second button of your mouse counting from the
696left---the middle button on a 3-button mouse. (On a 2-button mouse,
697you may have to press both buttons together to ``press the middle
698button''.) The message tells you pressing @kbd{Mouse-2} with the
699current position of the mouse pointer (on subtopic in the menu) will
700go to that subtopic.
701
702@findex Info-mouse-follow-nearest-node
703 More generally, @kbd{Mouse-2} in an Info buffer finds the nearest
704link to another node and goes there. For example, near a cross
705reference it acts like @kbd{f}, in a menu it acts like @kbd{m}, on the
706node's header line it acts like @kbd{n}, @kbd{p}, or @kbd{u}, etc. At
707end of the node's text @kbd{Mouse-2} moves to the next node, or up if
708there's no next node.
709
710@format
711>> Type @kbd{n} to see more commands.
712@end format
713
714@node Help-FOO, , , Help-M
715@subsection The @kbd{u} command
716
717 Congratulations! This is the node @samp{Help-FOO}. It has an @samp{Up}
718pointer @samp{Help-M}, the node you just came from via the @kbd{m}
719command. This is the usual convention---the nodes you reach from a menu
720have @samp{Up} nodes that lead back to the menu. Menus move Down in the
721tree, and @samp{Up} moves Up. @samp{Previous}, on the other hand, is
722usually used to ``stay on the same level but go backwards''.
723
724@kindex u @r{(Info mode)}
725@findex Info-up
726 You can go back to the node @samp{Help-M} by typing the command
727@kbd{u} for ``Up''. This puts you at the menu subtopic line pointing
728to the subnode that the @kbd{u} command brought you from. (Some Info
729readers may put you at the @emph{front} of the node instead---to get
730back to where you were reading, you have to type some @key{SPC}s.)
731
732 Another way to go Up is to click @kbd{Mouse-2} on the @samp{Up}
733pointer shown in the header line (provided that you have a mouse).
734
735@format
736>> Now type @kbd{u} to move back up to @samp{Help-M}.
737@end format
738
739@node Help-Xref, Help-Int, Help-M, Getting Started
740@comment node-name, next, previous, up
741@section Following Cross-References
742
743@cindex cross references in Info documents
744 In Info documentation, you will see many @dfn{cross references}.
745Cross references look like this: @xref{Help-Cross, Cross}. That text
746is a real, live cross reference, whose name is @samp{Cross} and which
747points to the node named @samp{Help-Cross}. (The node name is hidden
748in Emacs. Do @kbd{M-x visible-mode} to show or hide it.)
749
750@kindex f @r{(Info mode)}
751@findex Info-follow-reference
752 You can follow a cross reference by moving the cursor to it and
753press @key{RET}, just as in a menu. In Emacs, you can also click
754@kbd{Mouse-1} on a cross reference to follow it; you can see that the
755cross reference is mouse-sensitive by moving the mouse pointer to the
756reference and watching how the underlying text and the mouse pointer
757change in response.
758
759 Another way to follow a cross reference is to type @kbd{f} and then
760specify the name of the cross reference (in this case, @samp{Cross})
761as an argument. For this command, it does not matter where the cursor
762was. If the cursor is on or near a cross reference, @kbd{f} suggests
763that reference name in parentheses as the default; typing @key{RET}
764will follow that reference. However, if you type a different
765reference name, @kbd{f} will follow the other reference which has that
766name.
767
768@format
769>> Type @kbd{f}, followed by @kbd{Cross}, and then @key{RET}.
770@end format
771
772 As you enter the reference name, you can use the @key{DEL} (or
773@key{BACKSPACE}) key to edit your input. If you change your mind
774about following any reference, you can use @kbd{Control-g} to cancel
775the command. Completion is available in the @kbd{f} command; you can
776complete among all the cross reference names in the current node by
777typing a @key{TAB}.
778
779 To get a list of all the cross references in the current node, you
780can type @kbd{?} after an @kbd{f}. The @kbd{f} continues to await a
781cross reference name even after displaying the list, so if you don't
782actually want to follow a reference, you should type a @kbd{Control-g}
783to cancel the @kbd{f}.
784
785@format
786>> Type @kbd{f?} to get a list of the cross references in this node. Then
787 type a @kbd{Control-g} and see how the @samp{f} gives up.
788@end format
789
790 The @key{TAB}, @kbd{M-@key{TAB}} and @kbd{S-@key{TAB}} keys,
791which move between menu items in a menu, also move between cross
792references outside of menus.
793
794 Sometimes a cross reference (or a node) can lead to another file (in
795other words another ``manual''), or, on occasion, even a file on a
796remote machine (although Info files distributed with Emacs or the
797stand-alone Info avoid using remote links). Such a cross reference
798looks like this: @xref{Top,, Overview of Texinfo, texinfo, Texinfo:
799The GNU Documentation Format}. (After following this link, type
800@kbd{l} to get back to this node.) Here the name @samp{texinfo}
801between parentheses refers to the file name. This file name appears
802in cross references and node names if it differs from the current
803file, so you can always know that you are going to be switching to
804another manual and which one.
805
806However, Emacs normally hides some other text in cross-references.
807If you put your mouse over the cross reference, then the information
808appearing in a separate box (tool tip) or in the echo area will show
809the full cross-reference including the file name and the node name of
810the cross reference. If you have a mouse, just leave it over the
811cross reference @xref{Top,, Overview of Texinfo, texinfo, Texinfo:
812The GNU Documentation Format}, and watch what happens. If you
813always like to have that information visible without having to move
814your mouse over the cross reference, use @kbd{M-x visible-mode}, or
815set @code{Info-hide-note-references} to a value other than @code{t}
816(@pxref{Emacs Info Variables}).
817
818@format
819>> Now type @kbd{n} to learn more commands.
820@end format
821
822@node Help-Int, Help-Q, Help-Xref, Getting Started
823@comment node-name, next, previous, up
824@section Some intermediate Info commands
825
826 The introductory course is almost over; please continue
827a little longer to learn some intermediate-level commands.
828
829 Most Info files have an index, which is actually a large node
830containing little but a menu. The menu has one menu item for each
831topic listed in the index. (As a special feature, menus for indices
832may also include the line number within the node of the index entry.
833This allows Info readers to go to the exact line of an entry, not just
834the start of the containing node.)
835
836 You can get to the index from the main menu of the file with the
837@kbd{m} command and the name of the index node; then you can use the
838@kbd{m} command again in the index node to go to the node that
839describes the topic you want.
840
841 There is also a short-cut Info command, @kbd{i}, which does all of
842that for you. It searches the index for a given topic (a string) and
843goes to the node which is listed in the index for that topic.
844@xref{Search Index}, for a full explanation.
845
846@kindex l @r{(Info mode)}
847@findex Info-history-back
848@cindex going back in Info history
849 If you have been moving around to different nodes and wish to
850retrace your steps, the @kbd{l} command (@kbd{l} for @dfn{last}) will
851do that, one node-step at a time. As you move from node to node, Info
852records the nodes where you have been in a special history list. The
853@kbd{l} command revisits nodes in the history list; each successive
854@kbd{l} command moves one step back through the history.
855
856@format
857>> Try typing @kbd{p p n} and then three @kbd{l}'s, pausing in between
858to see what each @kbd{l} does. You should wind up right back here.
859@end format
860
861 Note the difference between @kbd{l} and @kbd{p}: @kbd{l} moves to
862where @emph{you} last were, whereas @kbd{p} always moves to the node
863which the header says is the @samp{Previous} node (from this node, the
864@samp{Prev} link leads to @samp{Help-Xref}).
865
866@kindex r @r{(Info mode)}
867@findex Info-history-forward
868@cindex going forward in Info history
869 You can use the @kbd{r} command (@code{Info-history-forward} in Emacs)
870to revisit nodes in the history list in the forward direction, so that
871@kbd{r} will return you to the node you came from by typing @kbd{l}.
872
17afb4cb
JL
873@kindex L @r{(Info mode)}
874@findex Info-history
875@cindex history list of visited nodes
876 The @kbd{L} command (@code{Info-history} in Emacs) creates a virtual
877node that contains a list of all nodes you visited. You can select
878a previously visited node from this menu to revisit it.
879
4009494e
GM
880@kindex d @r{(Info mode)}
881@findex Info-directory
882@cindex go to Directory node
883 The @kbd{d} command (@code{Info-directory} in Emacs) gets you
884instantly to the Directory node. This node, which is the first one
885you saw when you entered Info, has a menu which leads (directly or
886indirectly, through other menus), to all the nodes that exist. The
887Directory node lists all the manuals and other Info documents that
888are, or could be, installed on your system.
889
890@format
891>> Try doing a @kbd{d}, then do an @kbd{l} to return here (yes,
892 @emph{do} return).
893@end format
894
895@kindex t @r{(Info mode)}
896@findex Info-top-node
897@cindex go to Top node
898 The @kbd{t} command moves to the @samp{Top} node of the manual.
899This is useful if you want to browse the manual's main menu, or select
900some specific top-level menu item. The Emacs command run by @kbd{t}
901is @code{Info-top-node}.
902
903@format
904>> Now type @kbd{n} to see the last node of the course.
905@end format
906
907 @xref{Advanced}, for more advanced Info features.
908
909@c If a menu appears at the end of this node, remove it.
910@c It is an accident of the menu updating command.
911
912@node Help-Q, , Help-Int, Getting Started
913@comment node-name, next, previous, up
914@section Quitting Info
915
916@kindex q @r{(Info mode)}
917@findex Info-exit
918@cindex quitting Info mode
919 To get out of Info, back to what you were doing before, type @kbd{q}
920for @dfn{Quit}. This runs @code{Info-exit} in Emacs.
921
922 This is the end of the basic course on using Info. You have learned
923how to move in an Info document, and how to follow menus and cross
924references. This makes you ready for reading manuals top to bottom,
925as new users should do when they learn a new package.
926
927 Another set of Info commands is useful when you need to find
928something quickly in a manual---that is, when you need to use a manual
929as a reference rather than as a tutorial. We urge you to learn
930these search commands as well. If you want to do that now, follow this
931cross reference to @ref{Advanced}.
932
933Yet another set of commands are meant for experienced users; you can
934find them by looking in the Directory node for documentation on Info.
935Finding them will be a good exercise in using Info in the usual
936manner.
937
938@format
939>> Type @kbd{d} to go to the Info directory node; then type
940 @kbd{mInfo} and Return, to get to the node about Info and
941 see what other help is available.
942@end format
943
944
945@node Advanced
946@chapter Advanced Info Commands
947
948 This chapter describes various advanced Info commands. (If you
949are using a stand-alone Info reader, there are additional commands
950specific to it, which are documented in several chapters of @ref{Top,,
951GNU Info, info-stnd, GNU Info}.)
952
953@kindex C-q @r{(Info mode)}
954 One advanced command useful with most of the others described here
955is @kbd{C-q}, which ``quotes'' the next character so that it is
956entered literally (@pxref{Inserting Text,,,emacs,The GNU Emacs
957Manual}). For example, pressing @kbd{?} ordinarily brings up a list
958of completion possibilities. If you want to (for example) search for
959an actual @samp{?} character, the simplest way is to insert it using
960@kbd{C-q ?}. This works the same in Emacs and stand-alone Info.
961
962@menu
963* Search Text:: How to search Info documents.
964* Search Index:: How to search the indices for specific subjects.
965* Go to node:: How to go to a node by name.
966* Choose menu subtopic:: How to choose a menu subtopic by its number.
967* Create Info buffer:: How to create a new Info buffer in Emacs.
968* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.
969@end menu
970
971
972@node Search Text, Search Index, , Advanced
973@comment node-name, next, previous, up
2bc43980 974@section @kbd{s} searches Info documents
4009494e
GM
975
976@cindex searching Info documents
977@cindex Info document as a reference
978 The commands which move between and inside nodes allow you to read
979the entire manual or its large portions. But what if you need to find
980some information in the manual as fast as you can, and you don't know
981or don't remember in what node to look for it? This need arises when
982you use a manual as a @dfn{reference}, or when it is impractical to
983read the entire manual before you start using the programs it
984describes.
985
986 Info has powerful searching facilities that let you find things
987quickly. You can search either the manual text or its indices.
988
989@kindex s @r{(Info mode)}
990@findex Info-search
991 The @kbd{s} command allows you to search a whole Info file for a string.
992It switches to the next node if and when that is necessary. You
993type @kbd{s} followed by the string to search for, terminated by
994@key{RET}. To search for the same string again, just @kbd{s} followed
995by @key{RET} will do. The file's nodes are scanned in the order
996they are in the file, which has no necessary relationship to the
997order that they may be in the tree structure of menus and @samp{next}
998pointers. But normally the two orders are not very different. In any
999case, you can always look at the mode line to find out what node you have
1000reached, if the header is not visible (this can happen, because @kbd{s}
1001puts your cursor at the occurrence of the string, not at the beginning
1002of the node).
1003
4009494e
GM
1004@kindex C-s @r{(Info mode)}
1005@kindex C-r @r{(Info mode)}
1006@findex isearch
1007 Instead of using @kbd{s} in Emacs Info and in the stand-alone Info,
1008you can use an incremental search started with @kbd{C-s} or @kbd{C-r}.
1009It can search through multiple Info nodes. @xref{Incremental Search,,,
1010emacs, The GNU Emacs Manual}. In Emacs, you can disable this behavior
1011by setting the variable @code{Info-isearch-search} to @code{nil}
1012(@pxref{Emacs Info Variables}).
1013
1014@node Search Index, Go to node, Search Text, Advanced
1015@comment node-name, next, previous, up
2bc43980 1016@section @kbd{i} searches the indices for specific subjects
4009494e
GM
1017
1018@cindex searching Info indices
1019@kindex i @r{(Info mode)}
1020@findex Info-index
1021 Since most topics in the manual should be indexed, you should try
1022the index search first before the text search. The @kbd{i} command
1023prompts you for a subject and then looks up that subject in the
1024indices. If it finds an index entry with the subject you typed, it
1025goes to the node to which that index entry points. You should browse
1026through that node to see whether the issue you are looking for is
1027described there. If it isn't, type @kbd{,} one or more times to go
1028through additional index entries which match your subject.
1029
1030 The @kbd{i} command and subsequent @kbd{,} commands find all index
1031entries which include the string you typed @emph{as a substring}.
1032For each match, Info shows in the echo area the full index entry it
1033found. Often, the text of the full index entry already gives you
1034enough information to decide whether it is relevant to what you are
1035looking for, so we recommend that you read what Info shows in the echo
1036area before looking at the node it displays.
1037
1038 Since @kbd{i} looks for a substring, you can search for subjects even
1039if you are not sure how they are spelled in the index. For example,
1040suppose you want to find something that is pertinent to commands which
1041complete partial input (e.g., when you type @key{TAB}). If you want
1042to catch index entries that refer to ``complete,'' ``completion,'' and
1043``completing,'' you could type @kbd{icomplet@key{RET}}.
1044
1045 Info documents which describe programs should index the commands,
1046options, and key sequences that the program provides. If you are
1047looking for a description of a command, an option, or a key, just type
1048their names when @kbd{i} prompts you for a topic. For example, if you
1049want to read the description of what the @kbd{C-l} key does, type
1050@kbd{iC-l@key{RET}} literally.
1051
2bf1d02d
GM
1052@findex Info-virtual-index
1053@kindex I @r{(Info mode)}
1054Emacs provides the command @code{Info-virtual-index}, bound to the
1055@kbd{I} key. This behaves like @kbd{i}, but constructs a virtual
1056info node displaying the results of an index search, making it easier
1057to select the one you want.
1058
4009494e
GM
1059@findex info-apropos
1060@findex index-apropos
1061If you aren't sure which manual documents the topic you are looking
1062for, try the @kbd{M-x info-apropos} command in Emacs, or the @kbd{M-x
1063index-apropos} command in the stand-alone reader. It prompts for
1064a string and then looks up that string in all the indices of all the
1065Info documents installed on your system.
1066
1067@node Go to node, Choose menu subtopic, Search Index, Advanced
1068@comment node-name, next, previous, up
1069@section @kbd{g} goes to a node by name
1070
1071@kindex g @r{(Info mode)}
1072@findex Info-goto-node
1073@cindex go to a node by name
1074 If you know a node's name, you can go there by typing @kbd{g}, the
1075name, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the node
1076called @samp{Top} in this file. (This is equivalent to @kbd{t}, see
1077@ref{Help-Int}.) @kbd{gGo to node@key{RET}} would come back here.
1078
1079 Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.
1080But it does allow completion, so you can type @key{TAB} to complete a
1081partial node name.
1082
1083@cindex go to another Info file
1084 To go to a node in another file, you can include the file name in the
1085node name by putting it at the front, in parentheses. Thus,
1086@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which is
1087the node @samp{Top} in the Info file @file{dir}. Likewise,
1088@kbd{g(emacs)Top@key{RET}} goes to the top node of the Emacs manual.
1089
1090 The node name @samp{*} specifies the whole file. So you can look at
1091all of the current file by typing @kbd{g*@key{RET}} or all of any
1092other file with @kbd{g(@var{filename})*@key{RET}}.
1093
1094@node Choose menu subtopic, Create Info buffer, Go to node, Advanced
1095@comment node-name, next, previous, up
1096@section @kbd{1}--@kbd{9} choose a menu subtopic by its number
1097
1098@kindex 1 @r{through} 9 @r{(Info mode)}
1099@findex Info-nth-menu-item
1100@cindex select @var{n}'th menu item
1101 If you begrudge each character of type-in which your system requires,
1102you might like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4},
1103@dots{}, @kbd{9}. They are short for the @kbd{m} command together
1104with a name of a menu subtopic. @kbd{1} goes through the first item
1105in the current node's menu; @kbd{2} goes through the second item, etc.
1106In the stand-alone reader, @kbd{0} goes through the last menu item;
1107this is so you need not count how many entries are there.
1108
1109 If your display supports multiple fonts, colors or underlining, and
44e97401 1110you are using Emacs's Info mode to read Info files, the third, sixth
4009494e
GM
1111and ninth menu items have a @samp{*} that stands out, either in color
1112or in some other attribute, such as underline; this makes it easy to
1113see at a glance which number to use for an item.
1114
1115 Some terminals don't support either multiple fonts, colors or
1116underlining. If you need to actually count items, it is better to use
1117@kbd{m} instead, and specify the name, or use @key{TAB} to quickly
1118move between menu items.
1119
1120@node Create Info buffer, Emacs Info Variables, Choose menu subtopic, Advanced
1121@comment node-name, next, previous, up
1122@section @kbd{M-n} creates a new independent Info buffer in Emacs
1123
1124@kindex M-n @r{(Info mode)}
1125@findex clone-buffer
1126@cindex multiple Info buffers
1127 If you are reading Info in Emacs, you can select a new independent
1128Info buffer in a new Emacs window by typing @kbd{M-n}. The new buffer
1129starts out as an exact copy of the old one, but you will be able to
1130move independently between nodes in the two buffers. (In Info mode,
1131@kbd{M-n} runs the Emacs command @code{clone-buffer}.)
1132
1133 In Emacs Info, you can also produce new Info buffers by giving a
1134numeric prefix argument to the @kbd{m} and @kbd{g} commands. @kbd{C-u
1135m} and @kbd{C-u g} go to a new node in exactly the same way that
1136@kbd{m} and @kbd{g} do, but they do so in a new Info buffer which they
1137select in another window.
1138
1139 Another way to produce new Info buffers in Emacs is to use a numeric
1140prefix argument for the @kbd{C-h i} command (@code{info}) which
1141switches to the Info buffer with that number. Thus, @kbd{C-u 2 C-h i}
1142switches to the buffer @samp{*info*<2>}, creating it if necessary.
1143
2ebc3b94
GM
1144@findex info-display-manual
1145 If you have created many Info buffers in Emacs, you might find it
1146difficult to remember which buffer is showing which manual. You can
1147use the command @kbd{M-x info-display-manual} to show an Info manual
90d5efda 1148by name, reusing an existing buffer if there is one.
2ebc3b94 1149
4009494e
GM
1150@node Emacs Info Variables, , Create Info buffer, Advanced
1151@comment node-name, next, previous, up
1152@section Emacs Info-mode Variables
1153
1154The following variables may modify the behavior of Info-mode in Emacs;
1155you may wish to set one or several of these variables interactively,
1156or in your init file. @xref{Examining, Examining and Setting
1157Variables, Examining and Setting Variables, emacs, The GNU Emacs
1158Manual}. The stand-alone Info reader program has its own set of
1159variables, described in @ref{Variables,, Manipulating Variables,
1160info-stnd, GNU Info}.
1161
1162@vtable @code
1163@item Info-directory-list
1164The list of directories to search for Info files. Each element is a
1165string (directory name) or @code{nil} (try default directory). If not
1166initialized Info uses the environment variable @env{INFOPATH} to
1167initialize it, or @code{Info-default-directory-list} if there is no
1168@env{INFOPATH} variable in the environment.
1169
1170If you wish to customize the Info directory search list for both Emacs
1171Info and stand-alone Info, it is best to set the @env{INFOPATH}
1172environment variable, since that applies to both programs.
1173
1174@item Info-additional-directory-list
1175A list of additional directories to search for Info documentation files.
1176These directories are not searched for merging the @file{dir} file.
1177
1178@item Info-mode-hook
1179Hooks run when @code{Info-mode} is called. By default, it contains
1180the hook @code{turn-on-font-lock} which enables highlighting of Info
1181files. You can change how the highlighting looks by customizing the
1182faces @code{info-node}, @code{info-xref}, @code{info-xref-visited},
1183@code{info-header-xref}, @code{info-header-node}, @code{info-menu-header},
1184@code{info-menu-star}, and @code{info-title-@var{n}} (where @var{n}
1185is the level of the section, a number between 1 and 4). To customize
1186a face, type @kbd{M-x customize-face @key{RET} @var{face} @key{RET}},
1187where @var{face} is one of the face names listed here.
1188
1189@item Info-fontify-maximum-menu-size
1190Maximum size of menu to fontify if @code{font-lock-mode} is non-@code{nil}.
1191
1192@item Info-fontify-visited-nodes
1193If non-@code{nil}, menu items and cross-references pointing to visited
1194nodes are displayed in the @code{info-xref-visited} face.
1195
1196@item Info-use-header-line
1197If non-@code{nil}, Emacs puts in the Info buffer a header line showing
1198the @samp{Next}, @samp{Prev}, and @samp{Up} links. A header line does
1199not scroll with the rest of the buffer, making these links always
1200visible.
1201
1202@item Info-hide-note-references
1203As explained in earlier nodes, the Emacs version of Info normally
1204hides some text in menus and cross-references. You can completely
1205disable this feature, by setting this option to @code{nil}. Setting
1206it to a value that is neither @code{nil} nor @code{t} produces an
1207intermediate behavior, hiding a limited amount of text, but showing
1208all text that could potentially be useful.
1209
1210@item Info-scroll-prefer-subnodes
1211If set to a non-@code{nil} value, @key{SPC} and @key{BACKSPACE} (or
1212@key{DEL}) keys in a menu visit subnodes of the current node before
1213scrolling to its end or beginning, respectively. For example, if the
1214node's menu appears on the screen, the next @key{SPC} moves to a
1215subnode indicated by the following menu item. Setting this option to
1216@code{nil} results in behavior similar to the stand-alone Info reader
1217program, which visits the first subnode from the menu only when you
1218hit the end of the current node. The default is @code{nil}.
1219
1220@item Info-isearch-search
1221If non-@code{nil}, isearch in Info searches through multiple nodes.
1222
1223@item Info-enable-active-nodes
1224When set to a non-@code{nil} value, allows Info to execute Lisp code
1225associated with nodes. The Lisp code is executed when the node is
1226selected. The Lisp code to be executed should follow the node
1227delimiter (the @samp{DEL} character) and an @samp{execute: } tag, like
1228this:
1229
1230@example
1231^_execute: (message "This is an active node!")
1232@end example
1233@end vtable
1234
1235
1236@node Expert Info
1237@chapter Info for Experts
589ce070 1238@cindex Texinfo
4009494e
GM
1239
1240 This chapter explains how to write an Info file by hand. However,
1241in most cases, writing a Texinfo file is better, since you can use it
1242to make a printed manual or produce other formats, such as HTML and
1243DocBook, as well as for generating Info files.
1244
1245The @code{makeinfo} command converts a Texinfo file into an Info file;
1246@code{texinfo-format-region} and @code{texinfo-format-buffer} are GNU
1247Emacs functions that do the same.
1248
1249@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU
1250Documentation Format}, for how to write a Texinfo file.
1251
1252@xref{Creating an Info File,,, texinfo, Texinfo: The GNU Documentation
1253Format}, for how to create an Info file from a Texinfo file.
1254
1255@xref{Installing an Info File,,, texinfo, Texinfo: The GNU
1256Documentation Format}, for how to install an Info file after you
1257have created one.
1258
1259However, if you want to edit an Info file manually and install it manually,
1260here is how.
1261
1262@menu
1263* Add:: Describes how to add new nodes to the hierarchy.
1264 Also tells what nodes look like.
1265* Menus:: How to add to or create menus in Info nodes.
1266* Cross-refs:: How to add cross-references to Info nodes.
1267* Tags:: How to make tags tables for Info files.
1268* Checking:: Checking an Info File.
1269@end menu
1270
1271@node Add, Menus, , Expert Info
1272@comment node-name, next, previous, up
1273@section Adding a new node to Info
1274
1275To add a new topic to the list in the Info directory, you must:
1276
1277@enumerate
1278@item
1279Create some nodes, in some file, to document that topic.
1280@item
1281Put that topic in the menu in the directory. @xref{Menus, Menu}.
1282@end enumerate
1283
1284@cindex node delimiters
1285 The new node can live in an existing documentation file, or in a new
1286one. It must have a @samp{^_} character before it (invisible to the
1287user; this node has one but you cannot see it), and it ends with either
1288a @samp{^_}, a @samp{^L} (``formfeed''), or the end of file.@footnote{If
1289you put in a @samp{^L} to end a new node, be sure that there is a
1290@samp{^_} after it to start the next one, since @samp{^L} cannot
1291@emph{start} a node. Also, a nicer way to make a node boundary be a
1292page boundary as well is to put a @samp{^L} @emph{right after} the
1293@samp{^_}.}
1294
1295 The @samp{^_} starting a node must be followed by a newline or a
1296@samp{^L} newline, after which comes the node's header line. The
1297header line must give the node's name (by which Info finds it), and
1298state the names of the @samp{Next}, @samp{Previous}, and @samp{Up}
1299nodes (if there are any). As you can see, this node's @samp{Up} node
1300is the node @samp{Expert Info}. The @samp{Next} node is @samp{Menus}.
1301
1302@cindex node header line format
1303@cindex format of node headers
1304 The keywords @dfn{Node}, @dfn{Next}, @dfn{Previous}, and @dfn{Up}
1305may appear in any order, anywhere in the header line, but the
1306recommended order is the one in this sentence. Each keyword must be
1307followed by a colon, spaces and tabs, and then the appropriate name.
1308The name may be terminated with a tab, a comma, or a newline. A space
1309does not end it; node names may contain spaces. The case of letters
1310in the names is insignificant.
1311
1312@cindex node name format
1313@cindex Directory node
1314 A node name has two forms. A node in the current file is named by
1315what appears after the @samp{Node: } in that node's first line. For
1316example, this node's name is @samp{Add}. A node in another file is
1317named by @samp{(@var{filename})@var{node-within-file}}, as in
1318@samp{(info)Add} for this node. If the file name starts with @samp{./},
1319then it is relative to the current directory; otherwise, it is
1320relative starting from the standard directory for Info files of your
1321site. The name @samp{(@var{filename})Top} can be abbreviated to just
1322@samp{(@var{filename})}. By convention, the name @samp{Top} is used
1323for the ``highest'' node in any single file---the node whose @samp{Up}
1324points out of the file. The @samp{Directory} node is @file{(dir)}, it
1325points to a file @file{dir} which holds a large menu listing all the
1326Info documents installed on your site. The @samp{Top} node of a
1327document file listed in the @samp{Directory} should have an @samp{Up:
1328(dir)} in it.
1329
1330@cindex unstructured documents
1331 The node name @kbd{*} is special: it refers to the entire file.
1332Thus, @kbd{g*} shows you the whole current file. The use of the
1333node @kbd{*} is to make it possible to make old-fashioned,
1334unstructured files into nodes of the tree.
1335
1336 The @samp{Node:} name, in which a node states its own name, must not
1337contain a file name, since when Info searches for a node, it does not
1338expect a file name to be there. The @samp{Next}, @samp{Previous} and
1339@samp{Up} names may contain them. In this node, since the @samp{Up}
1340node is in the same file, it was not necessary to use one.
1341
1342 Note that the nodes in this file have a file name in the header
1343line. The file names are ignored by Info, but they serve as comments
1344to help identify the node for the user.
1345
1346@node Menus, Cross-refs, Add, Expert Info
1347@comment node-name, next, previous, up
1348@section How to Create Menus
1349
1350 Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes.
1351The @kbd{m} command searches the current node's menu for the topic which it
1352reads from the terminal.
1353
1354@cindex menu and menu entry format
1355 A menu begins with a line starting with @w{@samp{* Menu:}}. The
1356rest of the line is a comment. After the starting line, every line
1357that begins with a @samp{* } lists a single topic. The name of the
1358topic---what the user must type at the @kbd{m}'s command prompt to
1359select this topic---comes right after the star and space, and is
1360followed by a colon, spaces and tabs, and the name of the node which
1361discusses that topic. The node name, like node names following
1362@samp{Next}, @samp{Previous} and @samp{Up}, may be terminated with a
1363tab, comma, or newline; it may also be terminated with a period.
1364
1365 If the node name and topic name are the same, then rather than
1366giving the name twice, the abbreviation @samp{* @var{name}::} may be
1367used (and should be used, whenever possible, as it reduces the visual
1368clutter in the menu).
1369
1370 It is considerate to choose the topic names so that they differ
1371from each other very near the beginning---this allows the user to type
1372short abbreviations. In a long menu, it is a good idea to capitalize
1373the beginning of each item name which is the minimum acceptable
1374abbreviation for it (a long menu is more than 5 or so entries).
1375
1376 The nodes listed in a node's menu are called its ``subnodes,'' and it
1377is their ``superior''. They should each have an @samp{Up:} pointing at
1378the superior. It is often useful to arrange all or most of the subnodes
1379in a sequence of @samp{Next} and @samp{Previous} pointers so that
1380someone who wants to see them all need not keep revisiting the Menu.
1381
1382 The Info Directory is simply the menu of the node @samp{(dir)Top}---that
1383is, node @samp{Top} in file @file{.../info/dir}. You can put new entries
1384in that menu just like any other menu. The Info Directory is @emph{not} the
1385same as the file directory called @file{info}. It happens that many of
1386Info's files live in that file directory, but they do not have to; and
1387files in that directory are not automatically listed in the Info
1388Directory node.
1389
1390 Also, although the Info node graph is claimed to be a ``hierarchy,''
1391in fact it can be @emph{any} directed graph. Shared structures and
1392pointer cycles are perfectly possible, and can be used if they are
1393appropriate to the meaning to be expressed. There is no need for all
1394the nodes in a file to form a connected structure. In fact, this file
1395has two connected components. You are in one of them, which is under
1396the node @samp{Top}; the other contains the node @samp{Help} which the
1397@kbd{h} command goes to. In fact, since there is no garbage
1398collector on the node graph, nothing terrible happens if a substructure
1399is not pointed to, but such a substructure is rather useless since nobody
1400can ever find out that it exists.
1401
1402@node Cross-refs, Tags, Menus, Expert Info
1403@comment node-name, next, previous, up
1404@section Creating Cross References
1405
1406@cindex cross reference format
1407 A cross reference can be placed anywhere in the text, unlike a menu
1408item which must go at the front of a line. A cross reference looks
1409like a menu item except that it has @samp{*note} instead of @samp{*}.
1410It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s are
1411so often part of node names. If you wish to enclose a cross reference
1412in parentheses, terminate it with a period first. Here are two
1413examples of cross references pointers:
1414
1415@example
1416*Note details: commands. (See *note 3: Full Proof.)
1417@end example
1418
1419@noindent
1420@emph{These are just examples.} The places they ``lead to'' do not
1421really exist!
1422
1423@menu
1424* Help-Cross:: Target of a cross-reference.
1425@end menu
1426
1427
1428@node Help-Cross, , , Cross-refs
1429@subsection The node reached by the cross reference in Info
1430
1431 This is the node reached by the cross reference named @samp{Cross}.
1432
1433 While this node is specifically intended to be reached by a cross
1434reference, most cross references lead to nodes that ``belong''
1435someplace else far away in the structure of an Info document. So you
1436cannot expect this node to have a @samp{Next}, @samp{Previous} or
1437@samp{Up} links pointing back to where you came from. In general, the
1438@kbd{l} (el) command is the only way to get back there.
1439
1440@format
1441>> Type @kbd{l} to return to the node where the cross reference was.
1442@end format
1443
1444@node Tags, Checking, Cross-refs, Expert Info
1445@comment node-name, next, previous, up
1446@section Tags Tables for Info Files
1447
1448@cindex tags tables in Info files
1449 You can speed up the access to nodes of a large Info file by giving
1450it a tags table. Unlike the tags table for a program, the tags table for
1451an Info file lives inside the file itself and is used
1452automatically whenever Info reads in the file.
1453
1454@findex Info-tagify
1455 To make a tags table, go to a node in the file using Emacs Info mode and type
1456@kbd{M-x Info-tagify}. Then you must use @kbd{C-x C-s} to save the
1457file. Info files produced by the @code{makeinfo} command that is part
1458of the Texinfo package always have tags tables to begin with.
1459
1460@cindex stale tags tables
1461@cindex update Info tags table
1462 Once the Info file has a tags table, you must make certain it is up
1463to date. If you edit an Info file directly (as opposed to editing its
1464Texinfo source), and, as a result of deletion of text, any node moves back
1465more than a thousand characters in the file from the position
1466recorded in the tags table, Info will no longer be able to find that
1467node. To update the tags table, use the @code{Info-tagify} command
1468again.
1469
1470 An Info file tags table appears at the end of the file and looks like
1471this:
1472
1473@example
1474^_^L
1475Tag Table:
1476File: info, Node: Cross-refs^?21419
1477File: info, Node: Tags^?22145
1478^_
1479End Tag Table
1480@end example
1481
1482@noindent
1483Note that it contains one line per node, and this line contains
1484the beginning of the node's header (ending just after the node name),
1485a @samp{DEL} character, and the character position in the file of the
1486beginning of the node.
1487
1488@node Checking, , Tags, Expert Info
1489@section Checking an Info File
1490
1491When creating an Info file, it is easy to forget the name of a node when
1492you are making a pointer to it from another node. If you put in the
1493wrong name for a node, this is not detected until someone tries to go
1494through the pointer using Info. Verification of the Info file is an
1495automatic process which checks all pointers to nodes and reports any
1496pointers which are invalid. Every @samp{Next}, @samp{Previous}, and
1497@samp{Up} is checked, as is every menu item and every cross reference. In
1498addition, any @samp{Next} which does not have a @samp{Previous} pointing
1499back is reported. Only pointers within the file are checked, because
1500checking pointers to other files would be terribly slow. But those are
1501usually few.
1502
1503@findex Info-validate
1504To check an Info file, do @kbd{M-x Info-validate} while looking at any
1505node of the file with Emacs Info mode.
1506
1507@node Index
1508@unnumbered Index
1509
1510This is an alphabetical listing of all the commands, variables, and
1511topics discussed in this document.
1512
1513@printindex cp
1514
1515@bye