[English / Japanese]

mode-info --- Improved describe-function and describe-variable

Last Updated at $Date: 2007-11-03 03:53:24 $.

mode-info provides improved describe-function and describe-variable and combines major modes to edit programming languages and Info manuals written for those languages closely.


Emacs provides many commands to support our programming. Both describe-function which is a command to display documents of functions and describe-variable which is a command to display documents of variables are the most useful command among of them. For example, just type C-h f goto-char RET and you can see the documents of goto-char as follows.

Example of describe-function

Because both describe-function and describe-variable support only documents written for Emacs-Lisp, we can not use them to look documents written for other programming languages such as C, Scheme, and so on.

mode-info provides commands that look for appropriate documents from Info manuals written for programming languages, and that display them. They work like describe-function and describe-variable and have two advantages: (1) they can handle other programming languages than Emacs-Lisp, and (2) they estimate which programming language is used based on a major mode of this current buffer. mode-info-describe-function that is an improved version of describe-function tries to display an appropriate portion of Emacs Lisp Reference Manual when it is called in an emacs-lisp-mode buffer, while it tries to display an appropriate portion of GNU C Library Reference Manual when it is called in a cc-mode buffer.

Example of mode-info-describe-variable (in Japanese) Example of mode-info-describe-function


Anyone wanting to checkout the latest version of mode-info is welcome to use the anonymous CVS server to grab the most current developing code.

% cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot login
CVS password: # No password is set.  Just hit Enter/Return key.
% cvs -d :pserver:anonymous@cvs.namazu.org:/storage/cvsroot co mode-info

Source code access with ViewCVS is also available.

Supported Info Titles

mode-info supports these following Info manuals.

In order to support a new Info manual with mode-info, it is necessary to implement a simple module to extract documents of functions and variables from the Info manual. Please send a mail to tsuchiya@namazu.org for more detail.


Before installation, Info documents will have to be installed.

  1. Run configure script:
    This should setup stuffs to build mode-info. If Info documents are installed to an unusual directory, the installer will miss them. In this case, it is necessary to tell their place to the installer, as follows:
    ./configure --with-info-addpath=~/info
  2. Execute these commands to byte compile Emacs-Lisp programs and to install them.
    make install
  3. Execute these commands to make indices of all available Info titles and to install them.
    make index
    make install-index
    If you want to keep old indices, you can skip this step.
  4. Put these following expressions to your ~/.emacs.
    (require 'mi-config)
    (define-key global-map "\C-hf" 'mode-info-describe-function)
    (define-key global-map "\C-hv" 'mode-info-describe-variable)
    (define-key global-map "\M-." 'mode-info-find-tag)
    If you like much fontified Info manuals, add this expression to your ~/.emacs.
    (require 'mi-fontify)

If you cannot execute the configure script on your system, try following four steps: (1) byte compile all programs, (2) copy all programs to your favorite directory, (3) add above expressions your ~/.emacs, and (4) type M-x mode-info-make-all-indices RET. The last command will generate indices for all discovered Info manuals.


Just type C-h f function RET, and you can see the document of your specified function if it is available. To see documents of variables, type C-h v variable RET.


mode-info supports following Emacsens.

mode-info does not support older Emacsen than Emacs-19.30, because it uses modern backquote syntax.