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 section `Help' in The GNU Emacs Manual. Here we describe some program-level interfaces to the same information.
If do-all is non-nil
, then apropos
also shows
key bindings for the functions that are found.
If predicate is non-nil
, it should be a function to be
called on each symbol that has matched regexp. Only symbols for
which predicate returns a non-nil
value are listed or
displayed.
In the first of the following examples, apropos
finds all the
symbols with names containing `exec'. In the second example, it
finds and returns only those symbols that are also commands.
(We don't show 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) (apropos "exec" nil 'commandp) => (Buffer-menu-execute execute-extended-command)
The command C-h a (command-apropos
) calls apropos
,
but specifies a predicate to restrict the output to symbols that
are commands. The call to apropos
looks like this:
(apropos string t 'commandp)
apropos
in that it searches
documentation strings as well as symbol names for matches for
regexp. By default, it searches the documentation strings only
for preloaded functions and variables. If do-all is
non-nil
, it scans the names and documentation strings of all
functions and variables.
help-map
. It is defined in `help.el' as
follows:
(define-key global-map "\C-h" 'help-command) (fset 'help-command help-map)
nil
.
Otherwise it calls message
to display it in the echo area.
This function expects to be called inside a
with-output-to-temp-buffer
special form, and expects
standard-output
to have the value bound by that special form.
For an example of its use, see the long example in section Access to Documentation Strings.
help-form
is
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
's value is nil
. 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.
nil
, its value is a form to evaluate
whenever the character help-char
is read. If evaluating the form
produces a string, that string is displayed.
A command that calls read-event
or read-char
probably
should bind help-form
to a non-nil
expression while it
does input. (The exception is when C-h is meaningful input.)
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 section Minibuffer Miscellany).
describe-prefix-bindings
.
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 found in the library `helper'.
They are for modes that want to provide help without relinquishing
control, such as the "electric" modes. You must load that library
with (require 'helper)
in order to use them. Their names begin
with `Helper' to distinguish them from the ordinary help functions.
describe-bindings
.
nil
.
This can be customized by changing the map Helper-help-map
.
exec-directory
was used for this.
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
to
t
.
nil
, commands defined with
make-help-screen
display their help-line strings in the
echo area at first, and display the longer help-text strings only
if the user types the help character again.
Go to the first, previous, next, last section, table of contents.