📄 info.texi
字号:
* Tags:: How to make tag tables for Info files.* Checking:: Checking an Info File* Emacs Info Variables:: Variables modifying the behavior of Emacs Info.@end menu@node Expert, Add, , Advanced Info@comment node-name, next, previous, up@section Advanced Info Commands@kbd{g}, @kbd{s}, @kbd{1}, -- @kbd{9}, and @kbd{e}If you know a node's name, you can go there by typing @kbd{g}, thename, and @key{RET}. Thus, @kbd{gTop@key{RET}} would go to the nodecalled @samp{Top} in this file (its directory node).@kbd{gExpert@key{RET}} would come back here.Unlike @kbd{m}, @kbd{g} does not allow the use of abbreviations.To go to a node in another file, you can include the filename in thenode name by putting it at the front, in parentheses. Thus,@kbd{g(dir)Top@key{RET}} would go to the Info Directory node, which isnode @samp{Top} in the file @file{dir}.The node name @samp{*} specifies the whole file. So you can look atall of the current file by typing @kbd{g*@key{RET}} or all of anyother file with @kbd{g(FILENAME)@key{RET}}.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. Youtype @kbd{s} followed by the string to search for, terminated by@key{RET}. To search for the same string again, just @kbd{s} followedby @key{RET} will do. The file's nodes are scanned in the orderthey are in in the file, which has no necessary relationship to theorder that they may be in 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, ifthe header is not visible (this can happen, because @kbd{s} puts yourcursor at the occurrence of the string, not at the beginning of thenode).If you grudge the system each character of type-in it requires, youmight like to use the commands @kbd{1}, @kbd{2}, @kbd{3}, @kbd{4}, ...@kbd{9}. They are short for the @kbd{m} command together with anargument. @kbd{1} goes through the first item in the current node'smenu; @kbd{2} goes through the second item, etc.If you display supports multiple fonts, and you are using Emacs' Infomode to read Info files, the @samp{*} for the fifth menu item isunderlines, and so is the @samp{*} for the ninth item; these underlinesmake it easy to see at a glance which number to use for an item.On ordinary terminals, you won't have underlining. If you need toactually count items, it is better to use @kbd{m} instead, and specifythe name.The Info command @kbd{e} changes from Info mode to an ordinaryEmacs 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 allowedonly if the variable @code{Info-enable-edit} is non-@code{nil}.@node Add, Menus, Expert, Advanced Info@comment node-name, next, previous, up@section Adding a new node to InfoTo add a new topic to the list in the Info directory, you must:@enumerate@itemCreate some nodes, in some file, to document that topic.@itemPut that topic in the menu in the directory. @xref{Menus, Menu}.@end enumerateUsually, the way to create the nodes is with Texinfo @pxref{Top,, Overview ofTexinfo, texinfo, Texinfo: The GNU Documentation Format}); this has theadvantage that you can also make a printed manual from them. However,if hyou want to edit an Info file, here is how. The new node can live in an existing documentation file, or in a newone. It must have a @key{^_} character before it (invisible to theuser; this node has one but you cannot see it), and it ends with eithera @key{^_}, a @key{^L}, or the end of file. Note: If you put in a@key{^L} to end a new node, be sure that there is a @key{^_} after itto 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 wellis to put a @key{^L} @emph{right after} the @key{^_}. The @key{^_} starting a node must be followed by a newline or a@key{^L} newline, after which comes the node's header line. Theheader 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 (ifthere 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}. The keywords @dfn{Node}, @dfn{Previous}, @dfn{Up}, and @dfn{Next},may appear in any order, anywhere in the header line, but therecommended order is the one in this sentence. Each keyword must befollowed 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 spacedoes not end it; node names may contain spaces. The case of lettersin the names is insignificant. A node name has two forms. A node in the current file is named bywhat appears after the @samp{Node: } in that node's first line. Forexample, this node's name is @samp{Add}. A node in another file isnamed by @samp{(@var{filename})@var{node-within-file}}, as in@samp{(info)Add} for this node. If the file name starts with ``./'',then it is relative to the current directory; otherwise, it is relativestarting from the standard Info file directory 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 forthe ``highest'' node in any single file---the node whose @samp{Up} pointsout of the file. The Directory node is @file{(dir)}. The @samp{Top} nodeof a document file listed in the Directory should have an @samp{Up:(dir)} in it. The node name @kbd{*} is special: it refers to the entire file.Thus, @kbd{g*} shows you the whole current file. The use of thenode @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 notcontain a filename, since Info when searching for a node does notexpect one to be there. The @samp{Next}, @samp{Previous} and @samp{Up} names maycontain them. In this node, since the @samp{Up} node is in the same file,it was not necessary to use one. Note that the nodes in this file have a file name in the headerline. The file names are ignored by Info, but they serve as commentsto 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 Any node in the Info hierarchy may have a @dfn{menu}---a list of subnodes. The @kbd{m} command searches the current node's menu for the topic which itreads from the terminal. A menu begins with a line starting with @samp{* Menu:}. The rest of theline is a comment. After the starting line, every line that beginswith a @samp{* } lists a single topic. The name of the topic--theargument that the user must give to the @kbd{m} command to select thistopic---comes right after the star and space, and is followed by acolon, spaces and tabs, and the name of the node which discusses thattopic. 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 alsobe terminated with a period. If the node name and topic name are the same, then rather thangiving the name twice, the abbreviation @samp{* NAME::} may be used(and should be used, whenever possible, as it reduces the visualclutter in the menu). It is considerate to choose the topic names so that they differfrom each other very near the beginning---this allows the user to typeshort abbreviations. In a long menu, it is a good idea to capitalizethe beginning of each item name which is the minimum acceptableabbreviation for it (a long menu is more than 5 or so entries). The nodes listed in a node's menu are called its ``subnodes'', andit is their ``superior''. They should each have an @samp{Up:} pointing atthe superior. It is often useful to arrange all or most of thesubnodes in a sequence of @samp{Next} and @samp{Previous} pointers so that someone whowants to see them all need not keep revisiting the Menu. The Info Directory is simply the menu of the node @samp{(dir)Top}---thatis, node @samp{Top} in file @file{.../info/dir}. You can put new entriesin that menu just like any other menu. The Info Directory is @emph{not} thesame as the file directory called @file{info}. It happens that many ofInfo's files live on that file directory, but they do not have to; andfiles on that directory are not automatically listed in the InfoDirectory node. Also, although the Info node graph is claimed to be a ``hierarchy'',in fact it can be @emph{any} directed graph. Shared structures andpointer cycles are perfectly possible, and can be used if they areappropriate to the meaning to be expressed. There is no need for allthe nodes in a file to form a connected structure. In fact, this filehas two connected components. You are in one of them, which is underthe node @samp{Top}; the other contains the node @samp{Help} which the@kbd{h} command goes to. In fact, since there is no garbagecollector, nothing terrible happens if a substructure is not pointedto, but such a substructure is rather useless since nobody canever find out that it exists.@node Cross-refs, Tags, Menus, Advanced Info@comment node-name, next, previous, up@section Creating Cross References A cross reference can be placed anywhere in the text, unlike a menuitem which must go at the front of a line. A cross reference lookslike a menu item except that it has @samp{*note} instead of @kbd{*}.It @emph{cannot} be terminated by a @samp{)}, because @samp{)}'s areso often part of node names. If you wish to enclose a cross referencein parentheses, terminate it with a period first. Here are twoexamples of cross references pointers:@example*Note details: commands. (See *note 3: Full Proof.)@end exampleThey are just examples. The places they ``lead to'' do not really exist!@node Tags, Checking, Cross-refs, Advanced Info@comment node-name, next, previous, up@section Tag Tables for Info Files You can speed up the access to nodes of a large Info file by givingit a tag table. Unlike the tag table for a program, the tag table foran Info file lives inside the file itself and is used automatically whenever Info reads in the file. To make a tag 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 thefile. Once the Info file has a tag table, you must make certain it is upto date. If, as a result of deletion of text, any node moves backmore than a thousand characters in the file from the positionrecorded in the tag table, Info will no longer be able to find thatnode. To update the tag table, use the @code{Info-tagify} command again. An Info file tag table appears at the end of the file and looks likethis:@example^_Tag Table:File: info, Node: Cross-refs^?21419File: info, Node: Tags^?22145^_End Tag Table@end example@noindentNote that it contains one line per node, and this line containsthe beginning of the node's header (ending just after the node name),a Delete character, and the character position in the file of thebeginning of the node.@node Checking, Emacs Info Variables, Tags, Advanced Info@comment node-name, next, previous, up@section Checking an Info File When creating an Info file, it is easy to forget the name of a nodewhen you are making a pointer to it from another node. If you put inthe wrong name for a node, this is not detected until someonetries to go through the pointer using Info. Verification of the Infofile is an automatic process which checks all pointers to nodes andreports any pointers which are invalid. Every @samp{Next}, @samp{Previous}, and@samp{Up} is checked, as is every menu item and every cross reference. Inaddition, any @samp{Next} which does not have a @samp{Previous} pointing back isreported. Only pointers within the file are checked, because checkingpointers to other files would be terribly slow. But those are usuallyfew. To check an Info file, do @kbd{M-x Info-validate} while looking atany node of the file with Emacs Info mode.@node Emacs Info Variables, , Checking, Advanced Info@section Emacs Info-mode VariablesThe following variables may modify the behaviour of Info-mode in Emacs;you may wish to set one or several of these variables interactively, orin your @file{~/.emacs} init file. @xref{Examining, Examining and SettingVariables, Examining and Setting Variables, emacs, The GNU EmacsManual}.@vtable @code@item Info-enable-editSet to @code{nil}, disables the @samp{e} (@code{Info-edit}) command. Anon-@code{nil} value enables it. @xref{Add, Edit}.@item Info-enable-active-nodesWhen set to a non-@code{nil} value, allows Info to execute Lisp codeassociated with nodes. The Lisp code is executed when the node isselected.@item Info-directory-listThe list of directories to search for Info files. Each element is astring (directory name) or @code{nil} (try default directory).@item Info-directoryThe standard directory for Info documentation files. Only used when thefunction @code{Info-directory} is called.@end vtable@node Create an Info File, , Advanced Info, Top@comment node-name, next, previous, up@chapter Creating an Info File from a Makeinfo file@code{makeinfo} is a utility that converts a Texinfo file into an Infofile; @code{texinfo-format-region} and @code{texinfo-format-buffer} areGNU Emacs functions that do the same.@xref{Create an Info File, , Creating an Info File, texinfo, the TexinfoManual}, to learn how to create an Info file from a Texinfo file.@xref{Top,, Overview of Texinfo, texinfo, Texinfo: The GNU DocumentationFormat}, to learn how to write a Texinfo file.@bye
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -