manpagez: man pages & more
info emacs
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

11.3 Help by Command or Variable Name

C-h f function <RET> (describe-function) displays the documentation of Lisp function function, in a window. Since commands are Lisp functions, you can use this method to view the documentation of any command whose name you know. For example,

 
C-h f auto-fill-mode <RET>

displays the documentation of auto-fill-mode. This is the only way to 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 is also useful 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>. Because C-h f allows all function names, not just command names, you may find that some of your favorite completion abbreviations that work in M-x don't work in C-h f. An abbreviation that is unique among command names may not be unique among all function names.

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> will describe 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.

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 section Variables.

Help buffers that describe Emacs variables and functions normally have hyperlinks to the corresponding source definition, if you have the source files installed. (See section Hyperlinking and Navigation Features.) If you know Lisp (or C), this provides the ultimate documentation. If you don't know Lisp, you should learn it. (The Introduction to Emacs Lisp Programming, available from the FSF through fsf.org, is a good way to get started.) If Emacs feels you are just using it, treating it as an object program, its feelings may be hurt. For real intimacy, read the Emacs source code.

To find a function'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.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.