Next: Apropos, Previous: Documentation for a Key, Up: Help [Contents][Index]
C-h x command RET (describe-command
)
displays the documentation of the named command, in a
window. For example,
C-h x auto-fill-mode RET
displays the documentation of auto-fill-mode
. This is how you
would get the documentation of a command that is not bound to any key
(one which you would normally run using M-x).
C-h f function RET (describe-function
)
displays the documentation of Lisp function. This command is
intended for Lisp functions that you use in a Lisp program. For
example, if you have just written the expression
(make-vector len)
and want to check that you are using
make-vector
properly, type C-h f make-vector RET.
Additionally, since all commands are Lisp functions, you can also use
this command to view the documentation of any command.
If you type C-h f RET, it describes the function called
by the innermost Lisp expression in the buffer around point,
provided that function name is a valid, defined Lisp function.
(That name appears as the default while you enter the argument.) For
example, if point is located following the text ‘(make-vector
(car x)’, the innermost list containing point is the one that starts
with ‘(make-vector’, so C-h f RET describes the
function make-vector
.
C-h f is also useful just to verify that you spelled a function name correctly. If the minibuffer prompt for C-h f shows the function name from the buffer as the default, it means that name is defined as a Lisp function. Type C-g to cancel the C-h f command if you don’t really want to view the documentation.
The function’s documentation displayed by describe-function
includes more than just the documentation string and the signature of
the function. It also shows auxiliary information such as its type, the
file where it was defined, whether it has been declared obsolete, and
yet further information is often reachable by clicking or typing
RET on emphasized parts of the text.
The function type, if known, is expressed with a function type specifier (see Type Specifiers in The Emacs Lisp Reference Manual), it will be specified if the type was manually declared by a Lisp program or inferred by the compiler. Note that function type inference works only when native compilation is enabled (see native compilation in The Emacs Lisp Reference Manual).
If you request help for an autoloaded function whose autoload
form (see Autoload in The Emacs Lisp Reference Manual)
doesn’t provide a doc string, the *Help* buffer won’t have any
doc string to display. In that case, if
help-enable-symbol-autoload
is non-nil
, Emacs will try
to load the file in which the function is defined to see whether
there’s a doc string there.
You can get an overview of functions relevant for a particular topic
by using the M-x shortdoc command. This will prompt you for an
area of interest, e.g., string
, and pop you to a buffer where
many of the functions relevant for handling strings are listed.
You can also request that documentation of functions and commands shown in *Help* buffers popped by C-h f includes examples of their use. To that end, add the following to your initialization file (see The Emacs Initialization File):
(add-hook 'help-fns-describe-function-functions #'shortdoc-help-fns-examples-function)
C-h v (describe-variable
) is like C-h f but
describes Lisp variables instead of Lisp functions. Its default is
the Lisp symbol around or before point, if that is the name of a
defined Lisp variable. See Variables.
Help buffers that describe Emacs variables and functions normally have hyperlinks to the corresponding source code, if you have the source files installed (see Hyperlinking and Web Navigation Features).
To find a command’s documentation in a manual, use C-h F
(Info-goto-emacs-command-node
). This knows about various
manuals, not just the Emacs manual, and finds the right one.
C-h o (describe-symbol
) is like C-h f and
C-h v, but it describes any symbol, be it a function, a
variable, or a face. If the symbol has more than one definition, like
it has both definition as a function and as a variable, this command
will show the documentation of all of them, one after the other.
C-h 4 s (help-find-source
) switch to a buffer visiting
the source definition of what is being described in the help buffer.
If the completions-detailed
user option is non-nil
,
some commands provide details about the possible values when
displaying completions. For instance, C-h o TAB will then
include the first line of the doc string, and will also say whether
each symbol is a function or a variable (and so on). Which details
are included varies depending on the command used.
Next: Apropos, Previous: Documentation for a Key, Up: Help [Contents][Index]