Previous: Describing Characters, Up: Documentation
Emacs provides a variety of on-line help functions, all accessible to the user as subcommands of the prefix C-h. For more information about them, see Help. Here we describe some program-level interfaces to the same information.
This function finds all symbols whose names contain a match for the regular expression regexp, and returns a list of them (see Regular Expressions). It also displays the symbols in a buffer named ‘*Help*’, each with a one-line description taken from the beginning of its documentation string.
If do-all is non-
nil
, thenapropos
also shows key bindings for the functions that are found; it also shows all symbols, even those that are neither functions nor variables.In the first of the following examples,
apropos
finds all the symbols with names containing ‘exec’. (We don't show here the output that results in the ‘*Help*’ buffer.)(apropos "exec") => (Buffer-menu-execute command-execute exec-directory exec-path execute-extended-command execute-kbd-macro executing-kbd-macro executing-macro)
The value of this variable is a local keymap for characters following the Help key, C-h.
This symbol is not a function; its function definition cell holds the keymap known as
help-map
. It is defined in help.el as follows:(define-key global-map "\C-h" 'help-command) (fset 'help-command help-map)
This function builds a string that explains how to restore the previous state of the windows after a help command. After building the message, it applies function to it if function is non-
nil
. Otherwise it callsmessage
to display it in the echo area.This function expects to be called inside a
with-output-to-temp-buffer
special form, and expectsstandard-output
to have the value bound by that special form. For an example of its use, see the long example in Accessing Documentation.
The value of this variable is the help character—the character that Emacs recognizes as meaning Help. By default, its value is 8, which stands for C-h. When Emacs reads this character, if
help-form
is a non-nil
Lisp expression, it evaluates that expression, and displays the result in a window if it is a string.Usually the value of
help-form
isnil
. Then the help character has no special meaning at the level of command input, and it becomes part of a key sequence in the normal way. The standard key binding of C-h is a prefix key for several general-purpose help features.The help character is special after prefix keys, too. If it has no binding as a subcommand of the prefix key, it runs
describe-prefix-bindings
, which displays a list of all the subcommands of the prefix key.
The value of this variable is a list of event types that serve as alternative “help characters.” These events are handled just like the event specified by
help-char
.
If this variable is non-
nil
, its value is a form to evaluate whenever the characterhelp-char
is read. If evaluating the form produces a string, that string is displayed.A command that calls
read-event
orread-char
probably should bindhelp-form
to a non-nil
expression while it does input. (The time when you should not do this is when C-h has some other meaning.) Evaluating this expression should result in a string that explains what the input is for and how to enter it properly.Entry to the minibuffer binds this variable to the value of
minibuffer-help-form
(see Minibuffer Misc).
This variable holds a function to print help for a prefix key. The function is called when the user types a prefix key followed by the help character, and the help character has no binding after that prefix. The variable's default value is
describe-prefix-bindings
.
This function calls
describe-bindings
to display a list of all the subcommands of the prefix key of the most recent key sequence. The prefix described consists of all but the last event of that key sequence. (The last event is, presumably, the help character.)
The following two functions are meant for modes that want to provide help without relinquishing control, such as the “electric” modes. Their names begin with ‘Helper’ to distinguish them from the ordinary help functions.
This command pops up a window displaying a help buffer containing a listing of all of the key bindings from both the local and global keymaps. It works by calling
describe-bindings
.
This command provides help for the current mode. It prompts the user in the minibuffer with the message ‘Help (Type ? for further options)’, and then provides assistance in finding out what the key bindings are, and what the mode is intended for. It returns
nil
.This can be customized by changing the map
Helper-help-map
.
This variable holds the name of the directory in which Emacs finds certain documentation and text files that come with Emacs. In older Emacs versions,
exec-directory
was used for this.
This macro defines a help command named fname that acts like a prefix key that shows a list of the subcommands it offers.
When invoked, fname displays help-text in a window, then reads and executes a key sequence according to help-map. The string help-text should describe the bindings available in help-map.
The command fname is defined to handle a few events itself, by scrolling the display of help-text. When fname reads one of those special events, it does the scrolling and then reads another event. When it reads an event that is not one of those few, and which has a binding in help-map, it executes that key's binding and then returns.
The argument help-line should be a single-line summary of the alternatives in help-map. In the current version of Emacs, this argument is used only if you set the option
three-step-help
tot
.This macro is used in the command
help-for-help
which is the binding of C-h C-h.