This page explains how InfoMode finds Info manuals. If you have manuals on your machine in different locations, you might need to read this.

InfoMode uses the `INFOPATH' environment variable to initialize, so that the Info mode integrated in Emacs gives the same results as the standalone Info reader. `INFOPATH' is an environment variable containing a list of paths to the Info files installed on a system and is used by standalone Info readers to locate Info files.  The Info reader built into Emacs also uses INFOPATH, which ensures that Emacs will display the same Info files as the other Info readers installed on the system.

When InfoMode is invoked by typing <code>C-h i</code>, Emacs parses
INFOPATH and creates a list of Info directories in
<code>Info-directory-list</code>.  If you do not have <code>INFOPATH</code> set, you can use Emacs variable 
<code>Info-default-directory-list</code> for the same thing.  This variable is
only consulted when <code>INFOPATH</code> is not set, however.  If <code>INFOPATH</code> is not set, the default list of directories for the standalone Info reader (reported under info/C-h) will likely differ from the default list for the emacs Info reader.

If INFOPATH doesn't exist and `Info-directory-list' isn't set, Emacs is forced to improvise.  During Emacs
startup <code>Info-default-directory-list</code> is created: this contains a list of directory names that, on a GNU/Linux system, can usually be relied on to contain Info files.  The last directory in <code>Info-default-directory-list</code> is the info directory within the Emacs installation directory: this guarantees that Emacs will be able to display its own Info files even if it fails to find any others.

The order of directories in these lists is relevant.  It determines the order of the
entries in the main Info menu (`dir'), so it determines which copy of a
manual is opened whenever several copies with the same name exist.  The
first one found will be opened.

Example of setting the list for use in Emacs on Windows:

       (setq Info-default-directory-list
             (append '("c:/Emacs/site-lisp/gnus-5.8.3/texi" "c:/Emacs/info")
                     Info-default-directory-list
                     '("~/info" "~/full-man/info")))

This code adds directories before and after the original list of directories (`Info-default-directory-list'). Directory <code>~/info</code> allows for extension and customization of the documentation system for personal use - `##~##' is your home directory.

As Emacs will always use INFOPATH if it exists, there is no point in
trying to modify <code>Info-default-directory-list</code> on a system
where INFOPATH is defined.  Even on a system that doesn't have an
INFOPATH it will almost always be better to create INFOPATH than to
try to configure Emacs through <code>Info-default-directory-list</code>.

The only exception is on a native Microsoft Windows installation that
doesn't have any standalone Info readers installed.  Under Windows,
installing a new version of Emacs will ''not'' usually update INFOPATH
and this means that, unless you remember to update it manually,
INFOPATH will still point to the Info files for the previous Emacs
installation.  And it is ''really'' hard to spot that you are looking
slightly out-of-date Info pages!

So for native Windows it is strategically better to avoid INFOPATH and
to use <code>Info-default-directory-list</code>.  As noted above, this
always contains the Info directory for the executing version of Emacs
so all that is required is to add any other Info directories to the
list.  The easiest way is to use <code>add-to-list</code> in file
<code>site-start.el</code> or the InitFile:-

    (add-to-list 'Info-default-directory-list "C:/path/to/my/info")

The <code>add-to-list</code> function adds the specified directory to
the ''front'' of the list, which means that the directory will be
searched ''before'' the standard Emacs Info directory.  This is
normally the behaviour you want.

Even though the docstrings of at least GnuEmacs 21.2.1 claim
otherwise, '''dir'''-files along the
<code>Info-additional-directory-list</code> are ''not'' excluded when
the Info top-menu is rendered.  For some reason, this feature is not
supported anymore.  Some might be sorry for this, because it used to
make possible having one's own, clean dir-file, and still let the
references to other manuals work.  The standalone inforeader
'''info'''(1) still supports this.

One good setup is to have the environment variable INFOPATH point to
one's own info directories, say <code>~/info</code>, and then set
`Info-additional-directory-list' to
`Info-default-directory-list' in DotEmacs or similar Emacs startup
file.  This way the top-directory that one gets with <code>C-h
i</code> lists the users own info-dir, from the file
<code>~/info/dir</code> first (which might end in some visible
separator), onto which the system-wide info-dir is appended.  for
convenience, one might want to add a link from one's own personal
info-dir to the system-wide info-dir.  Binding <code>d</code> then
takes one to one's own info-dir, and a <code>u</code> from there leads
to the system-wide version.  Here's what [[tekonivel]]'s setup looks
like:

First, the environment variable is set upon shell startup, say in
<code>.profile</code>:

    export INFOPATH="~/info"

then in DotEmacs

    (add-hook 'Info-mode-hook		; After Info-mode has started
        (lambda ()
    	    (setq Info-additional-directory-list Info-default-directory-list)
    	))

And then the <code>~/info/dir</code> file will include, at the top
The '^_' are special chars (input in hexl-mode: 1f0a 0a is newline) you can also copy and paste them from the e.g. /usr/share/info/dir -file.

    ^_
    File: dir,		Node: Top,	Up: (/usr/info/dir)
      ##
            This is your very own [D]irectory of Info manuals.
     ###    To see the common directory set up for the system,
      ##    move [U]p from here.
      ##

    * Menu:

and at the bottom write an informative text followed by an empty new line:

    ---- User's `dir' ends here ----


A bit of a hassle, but ought to do it.

Also remember that even if a manual is not on the menu you're looking
at, you can move to any node, say <code>(texinfo)Directory File</code>
along any of Info's paths with <code>Info-goto-node</code>, at
<code>g</code>.  Do mind the parentheses.

I have tried all of the above, nothing works(v23.4+1-4 debian wheezy).
I found the solution in the elpa package.el-file:
Put this in the .emacs:

 ;; FIXME: not the friendliest, but simple.
 (require 'info)
 (info-initialize)
 (push "/home/user/info" Info-directory-list)


Then create a 'dir'-file in that path (/home/user/info): A dir file is the main file where all the info-file point to. To find the main dir file C-h i C-x C-f.

The dir file in that path (/home/user/info) will the be merged with the main dir file when the directory (/home/user/info) is added to Info-directory-list.

The dir file must have the following format. 

 This is the file .../home/user/dir, which contains the
 topmost node of the Info hierarchy, called (dir)Top.
 The first time you invoke Info you start off looking at this node.
  
 File: dir,	Node: Top	This is the top of the INFO tree
 
         This is your very own [D]irectory of Info manuals.
         To see the common directory set up for the system,
         move [U]p from here.
 * Menu:
 Emacs
 * Emacs: (emacs).              The extensible self-documenting text editor.
 * elisp: (elisp).		Emacs elisp reference manual.
 * eintr: (eintr).		An Introduction to Programming in Emacs Lisp.


You only have to modify the info file you wish to reference. For example if we want to add gdb

 * gdb (gdb).                   Description of gdb.


Note: no ##--- end mark ---\n## at the end of the file was needed.

Note: Above the line with 'File: dir...' there is a line with a unprintable char, which is showed by emacs as '^_', it is actually one byte (1f in hex), you can input hex-chars with the M-x hexl-mode.

Note: C-h i mixes the different sub-group-menus into one single view, e.g. the group 'Emacs' in the above case.

Note: lines that begin with '*'-char have the following form (Notice the [.]):

 * menu-name: (file-name).     description.

Here's what it means:

* '''##menu-name##''' can be selected with the input `m menu-name' (`m' uses completion)

* '''##file-name##''' is without the ##info.gz## suffix the file might have

You can also generate a ##dir## file in the following way. 
In the shell go to the path where the info file is then run the command



  install-info YOURFILE.info.gz dir


In Debian Stretch (Debian 4.9.65-3+deb9u2 (2018-01-04)), the <code>/usr/share/info/emacs-25/</code> directory contained the ##.info.gz## files and was present in the ##Info-directory-list## variable within Emacs.  I was able to include the desired documentation pages to the Info menu by creating 'dir' file within the <code>/usr/share/info/emacs-25/</code> directory itself.

----
CategoryDocumentation
CategoryHelp
CategoryModes
CategoryPaths
