13 Manipulating Variables

GNU Info uses several internal variables whose values are looked at by various Info commands. You can change the values of these variables, and thus change the behavior of Info, if desired.

There are three ways to set the value of a variable, listed here in order of precedence:

  1. interactively, using the set-variable command described below;
  2. on the command line, using the -v (--variable) command line option (see variable-assignment);
  3. in the #var section of the .infokey file (see Customizing Key Bindings and Variables).
M-x set-variable

Read the name of a variable, and the value for it, in the echo area and then set the variable to that value. Completion is available when reading the variable name (see The Echo Area); completion is also available when reading the value when that makes sense.

M-x describe-variable

Read the name of a variable in the echo area and display its value and a brief description.

Here is a list of the variables that you can set in Info.

automatic-footnotes

When set to On, footnotes appear and disappear automatically; else, they appear at the bottom of the node text. This variable is Off by default. When a node is selected, a window containing the footnotes which appear in that node is created, and the footnotes are displayed within the new window. The window that Info creates to contain the footnotes is called *Footnotes*. If a node is selected which contains no footnotes, and a *Footnotes* window is on the screen, the *Footnotes* window is deleted. Footnote windows created in this fashion are not automatically tiled so that they can use as little of the display as is possible.

automatic-tiling

When set to On, creating or deleting a window resizes other windows. This variable is Off by default. Normally, typing ‘C-x 2’ divides the current window into two equal parts. When automatic-tiling is set to On, all of the windows are resized automatically, keeping an equal number of lines visible in each window. Any *Completions* and *Footnotes* windows are exceptions to the automatic tiling; they retain their original size.

cursor-movement-scrolls

When set to On, when cursor movement commands reach the top or bottom of a node, another node is loaded depending on the value of scroll-behavior (see below). This is the default. When this variable is set to Off, cursor movements stop at the top or bottom of a node.

errors-ring-bell

When set to On (the default), errors cause the bell to ring.

follow-strategy

When set to remain (the default), Info tries to remain within the directory containing the currently displayed Info file when following a cross-reference to an external manual, before looking for the referenced manual in the search path. The alternative value is path, which means to look through the search path right away.

remain is intended to be useful for several Texinfo manuals that all reference each other and whose versions should match each other. (For example, various manuals relating to a particular version of Emacs.)

The alternative behavior, with path, may be useful when your Info file search path parallels your command shell’s search path, and you always want to find documentation of the version of the program that the shell would execute.

gc-compressed-files

When set to On, Info garbage collects files which had to be uncompressed. The default value of this variable is Off. Whenever a node is visited in Info, the Info file containing that node is read into memory, and Info reads information about the tags and nodes contained in that file. Once the tags information is read by Info, it is never forgotten. However, the actual text of the nodes does not need to be retained unless a particular Info window needs it. For non-compressed files, node text is not remembered when it is no longer in use. But de-compressing a file can be a time-consuming operation, and so Info tries hard not to do it twice. This variable tells Info it is okay to garbage collect the text of the nodes of a file which was compressed on disk.

hide-note-references

By default, Info displays the contents of Info files mostly verbatim, including text that is used by Info readers for navigation (for example, marking the location of menus or cross-references). If you set this variable to On, some of this text is hidden, in a similar way to the Info-hide-note-references variable in Emacs (see Emacs Info Variables in Info).

highlight-searches

When set to On, highlight matches from searching commands (see Searching an Info File).

infopath-no-defaults

Used in conjunction with the INFOPATH environment variable (see INFOPATH). When set to On, the default documentation directory defined when Info was built (e.g., /usr/share/info) is not added to the search path for Info files.

ISO-Latin

The default is On, which means that Info accepts and displays characters represented by bytes with values 128 and above, such as characters in the UTF-8 encoding or in various 8-bit ISO Latin characters, as well as allowing you to input such characters.

The only reason to set this variable to Off would be if your terminal set the eighth bit of a byte to represent the Meta key being pressed.

key-time

Length of time in milliseconds to wait for the next byte of a byte sequence generated by a key (or key chord) on the keyboard. For example, if the down key generates the byte sequence ESC O B, and the two bytes ESC O have been received, then a B byte would have to be received within this length of time for a key press of down to be registered. You may wish to set this variable to a larger value for slow terminals or network connections.

If you set this variable to 0, it’s unspecified whether a recognized byte sequence representing a key takes precedence over another recognized sequence representing a key that is an initial subsequence of the first sequence. In some cases, you may be able to make pressing a special key on the keyboard that Info doesn’t know about (for example, a function key) cause a command to be executed by setting this variable to 0, and giving the byte sequence the key sends in .infokey. (See Customizing Key Bindings and Variables.)

min-search-length

Minimum length of a search string (default 1). Attempts to initiate a search for a string (or regular expression) shorter than this value, result in an error.

mouse

What method to use to get input from a mouse device. The default value is ‘Off’. Set this variable to normal-tracking to make Info use “normal tracking mode” if it detects that the terminal supports it. This enables you to scroll the contents of the active window with a mouse scrollwheel.

On terminal emulators running under the X Window System, such as xterm, you can usually select text with the mouse. However, mouse tracking mode may interfere with this. When this happens, you may be able to select text by holding down the Shift key while clicking and dragging.

nodeline

How to print the node header line that appears at the top of each node. By default only the pointers to neighbouring nodes are displayed (the “Next”, “Prev”, and “Up” pointers): this corresponds to the pointers value for this variable. To print the entire line, set nodeline to the value print, which will include the filename and name of the node. To not display the header line at all, use the value no.

scroll-behavior
scroll-behaviour

The two variable names are synonymous. Control what happens when scrolling commands are used at the end or beginning of a node (see Moving Text Within a Window). The default value for this variable is Continuous. Possible values:

Continuous

Try to get the first item in this node’s menu, or failing that, the ‘Next’ node, or failing that, the ‘Next’ of the ‘Up’ node. This behavior is identical to using the ‘]’ (global-next-node) and ‘[’ (global-prev-node) commands.

Next Only

Only try to get the ‘Next’ node.

Page Only

Just stop, changing nothing. With this value, no scrolling command can change the node that is being viewed.

This variable also affects cursor movement commands (see Moving the Cursor) unless the cursor-movement-scrolls variable is set to Off. See cursor-movement-scrolls.

scroll-last-node

Control what happens when a scrolling command is issued at the end of the last node. Possible values are:

Stop

Do not scroll. Display the ‘No more nodes within this document’ message. This is the default.

Top

Go to the top node of the document.

This variable is in effect only if scroll-behavior is set to Continuous.

scroll-step

The number of lines to scroll to bring the cursor back into the window. The default value of this variable is 1, which causes a kind of “smooth scrolling” which some people prefer. Scrolling happens automatically if the cursor has moved out of the visible portion of the node text.

If the variable scroll-step is 0, the cursor (and the text it is attached to) is placed in the centre of the window.

search-skip-screen

Set the starting point of repeated searches (see repeated-search). When set to Off (the default), repeated searches start at the position immediately following (when searching in forward direction), or immediately preceding (when searching backwards) the cursor. When set to On, repeated searches omit lines visibly displayed on the screen. In other words, forward searches (}) start at the beginning of the next page, and backward searches ({) start at the end of the previous page.

show-index-match

When set to On (the default), the portion of the matched search string that you typed is indicated (by displaying it in the “opposite” case) in the result message (see next-index-match).

visible-bell

When set to On, Info attempts to flash the screen instead of ringing the bell. This variable is Off by default. If the terminal does not allow flashing, this variable has no effect. (But you can still make Info perform quietly by setting the errors-ring-bell variable to Off; or using an external command to mute the bell, e.g., xset b 0 0 0.)