Next: , Previous: , Up: Installing an Info File   [Contents][Index]


21.2.3 Info Files in Other Directories

If an Info file is not in the info directory, there are three ways to specify its location:

  1. Write the pathname in the dir file as the second part of the menu.
  2. Specify the Info directory name in the INFOPATH environment variable in your .profile or .cshrc initialization file. (Only you and others who set this environment variable will be able to find Info files whose location is specified this way.)
  3. If you are using Emacs, list the name of the file in a second dir file, in its directory; and then add the name of that directory to the Info-directory-list variable in your personal or site initialization file.

    This variable tells Emacs where to look for dir files (the files must be named dir). Emacs merges the files named dir from each of the listed directories. (In Emacs version 18, you can set the Info-directory variable to the name of only one directory.)

For example, to reach a test file in the /home/bob/info directory, you could add an entry like this to the menu in the standard dir file:

* Test: (/home/bob/info/info-test).  Bob's own test file.

In this case, the absolute file name of the info-test file is written as the second part of the menu entry.

If you don’t want to edit the system dir file, you can tell Info where to look by setting the INFOPATH environment variable in your shell startup file. This works with both the Emacs and standalone Info readers.

Specifically, if you use a Bourne-compatible shell such as sh or bash for your shell command interpreter, you set the INFOPATH environment variable in the .profile initialization file; but if you use csh or tcsh, you set the variable in the .cshrc initialization file. On MS-DOS/MS-Windows systems, you must set INFOPATH in your autoexec.bat file or in the registry. Each type of shell uses a different syntax.

The ‘.’ indicates the current directory as usual. Emacs uses the INFOPATH environment variable to initialize the value of Emacs’s own Info-directory-list variable. The standalone Info reader merges any files named dir in any directory listed in the INFOPATH variable into a single menu presented to you in the node called ‘(dir)Top’.

However you set INFOPATH, if its last character is a colon (on MS-DOS/MS-Windows systems, use a semicolon instead), this is replaced by the default (compiled-in) path. This gives you a way to augment the default path with new directories without having to list all the standard places. For example (using sh syntax):

INFOPATH=/home/bob/info:
export INFOPATH

will search /home/bob/info first, then the standard directories. Leading or doubled colons are not treated specially.

When you create your own dir file for use with Info-directory-list or INFOPATH, it’s easiest to start by copying an existing dir file and replace all the text after the ‘* Menu:’ with your desired entries. That way, the punctuation and special CTRL-_ characters that Info needs will be present.

As one final alternative, which works only with Emacs Info, you can change the Info-directory-list variable. For example:

(add-hook 'Info-mode-hook '(lambda ()
	     (add-to-list 'Info-directory-list
			  (expand-file-name "~/info"))))

Next: , Previous: , Up: Installing an Info File   [Contents][Index]