Download GNU Emacs Manual

Transcript
Chapter 7: Help
65
C-h w command hRETi tells you what keys are bound to command. It
displays a list of the keys in the echo area. If it says the command is not on
any key, you must use M-x to run it. C-h w runs the command where-is.
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, but only if that is the name of a known Lisp variable. See Section 32.2
[Variables], page 445.
Help buffers describing variables or functions defined in Lisp normally
have hyperlinks to the Lisp definition, if you have the Lisp source files installed. If you know Lisp, this provides the ultimate documentation. If you
don’t know Lisp, you should learn it. If you are treating Emacs as an object
file, then you are just using Emacs. For real intimacy with Emacs, you must
read the source code.
7.3 Apropos
A more sophisticated sort of question to ask is, “What are the commands for
working with files?” To ask this question, type C-h a file hRETi, which displays a list of all command names that contain ‘file’, including copy-file,
find-file, and so on. With each command name appears a brief description of how to use the command, and what keys you can currently invoke it
with. For example, it would say that you can invoke find-file by typing
C-x C-f. The a in C-h a stands for “Apropos”; C-h a runs the command
apropos-command. This command normally checks only commands (interactive functions); if you specify a prefix argument, it checks noninteractive
functions as well.
Because C-h a looks only for functions whose names contain the string you
specify, you must use ingenuity in choosing the string. If you are looking for
commands for killing backwards and C-h a kill-backwards hRETi doesn’t
reveal any, don’t give up. Try just kill, or just backwards, or just back. Be
persistent. Also note that you can use a regular expression as the argument,
for more flexibility (see Section 12.5 [Regexps], page 112).
Here is a set of arguments to give to C-h a that covers many classes of
Emacs commands, since there are strong conventions for naming the standard Emacs commands. By giving you a feel for the naming conventions,
this set should also serve to aid you in developing a technique for picking
apropos strings.
char, line, word, sentence, paragraph, region, page, sexp, list, defun,
rect, buffer, frame, window, face, file, dir, register, mode, beginning,
end, forward, backward, next, previous, up, down, search, goto, kill,
delete, mark, insert, yank, fill, indent, case, change, set, what, list,
find, view, describe, default.
To list all user variables that match a regexp, use the command M-x
apropos-variable. This command shows only user variables and cus-