1 |
@c -*-texinfo-*- |
@c -*-texinfo-*- |
2 |
@c This is part of the GNU Emacs Lisp Reference Manual. |
@c This is part of the GNU Emacs Lisp Reference Manual. |
3 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999 |
@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999, 2004 |
4 |
@c Free Software Foundation, Inc. |
@c Free Software Foundation, Inc. |
5 |
@c See the file elisp.texi for copying conditions. |
@c See the file elisp.texi for copying conditions. |
6 |
@setfilename ../info/help |
@setfilename ../info/help |
59 |
stand for key bindings to be looked up in the current keymaps when the |
stand for key bindings to be looked up in the current keymaps when the |
60 |
documentation is displayed. This allows documentation strings to refer |
documentation is displayed. This allows documentation strings to refer |
61 |
to the keys for related commands and be accurate even when a user |
to the keys for related commands and be accurate even when a user |
62 |
rearranges the key bindings. (@xref{Accessing Documentation}.) |
rearranges the key bindings. (@xref{Keys in Documentation}.) |
63 |
|
|
64 |
In Emacs Lisp, a documentation string is accessible through the |
In Emacs Lisp, a documentation string is accessible through the |
65 |
function or variable that it describes: |
function or variable that it describes: |
260 |
user option; see the description of @code{defvar} in @ref{Defining |
user option; see the description of @code{defvar} in @ref{Defining |
261 |
Variables}. |
Variables}. |
262 |
|
|
|
@anchor{Definition of Snarf-documentation} |
|
263 |
@defun Snarf-documentation filename |
@defun Snarf-documentation filename |
264 |
|
@anchor{Definition of Snarf-documentation} |
265 |
This function is used only during Emacs initialization, just before |
This function is used only during Emacs initialization, just before |
266 |
the runnable Emacs is dumped. It finds the file offsets of the |
the runnable Emacs is dumped. It finds the file offsets of the |
267 |
documentation strings stored in the file @var{filename}, and records |
documentation strings stored in the file @var{filename}, and records |
282 |
|
|
283 |
In most cases, this is the same as @code{data-directory}. They may be |
In most cases, this is the same as @code{data-directory}. They may be |
284 |
different when you run Emacs from the directory where you built it, |
different when you run Emacs from the directory where you built it, |
285 |
without actually installing it. See @code{data-directory} in @ref{Help |
without actually installing it. @xref{Definition of data-directory}. |
|
Functions}. |
|
286 |
|
|
287 |
In older Emacs versions, @code{exec-directory} was used for this. |
In older Emacs versions, @code{exec-directory} was used for this. |
288 |
@end defvar |
@end defvar |
374 |
characters. The description of a non-whitespace printing character is |
characters. The description of a non-whitespace printing character is |
375 |
the character itself. |
the character itself. |
376 |
|
|
377 |
@defun key-description sequence |
@defun key-description sequence &optional prefix |
378 |
@cindex Emacs event standard notation |
@cindex Emacs event standard notation |
379 |
This function returns a string containing the Emacs standard notation |
This function returns a string containing the Emacs standard notation |
380 |
for the input events in @var{sequence}. The argument @var{sequence} may |
for the input events in @var{sequence}. If @var{prefix} is |
381 |
be a string, vector or list. @xref{Input Events}, for more information |
non-@code{nil}, it is a sequence of input events leading up to |
382 |
about valid events. See also the examples for |
@var{sequence} and is included in the return value. Both arguments |
383 |
@code{single-key-description}, below. |
may be strings, vectors or lists. @xref{Input Events}, for more |
384 |
|
information about valid events. |
385 |
|
|
386 |
|
@smallexample |
387 |
|
@group |
388 |
|
(key-description [?\M-3 delete]) |
389 |
|
@result{} "M-3 <delete>" |
390 |
|
@end group |
391 |
|
@group |
392 |
|
(key-description [delete] "\M-3") |
393 |
|
@result{} "M-3 <delete>" |
394 |
|
@end group |
395 |
|
@end smallexample |
396 |
|
|
397 |
|
See also the examples for @code{single-key-description}, below. |
398 |
@end defun |
@end defun |
399 |
|
|
400 |
@defun single-key-description event &optional no-angles |
@defun single-key-description event &optional no-angles |
445 |
standard Emacs notation for characters that appear in text---like |
standard Emacs notation for characters that appear in text---like |
446 |
@code{single-key-description}, except that control characters are |
@code{single-key-description}, except that control characters are |
447 |
represented with a leading caret (which is how control characters in |
represented with a leading caret (which is how control characters in |
448 |
Emacs buffers are usually displayed) and character codes 128 |
Emacs buffers are usually displayed). Another difference is that |
449 |
and above are not treated as Meta characters. |
@code{text-char-description} recognizes the 2**7 bit as the Meta |
450 |
|
character, whereas @code{single-key-description} uses the 2**27 bit |
451 |
|
for Meta. |
452 |
|
|
453 |
@smallexample |
@smallexample |
454 |
@group |
@group |
463 |
(text-char-description ?\C-\M-m) |
(text-char-description ?\C-\M-m) |
464 |
@result{} "\x8d" |
@result{} "\x8d" |
465 |
@end group |
@end group |
466 |
|
@group |
467 |
|
(text-char-description (+ 128 ?m)) |
468 |
|
@result{} "M-m" |
469 |
|
@end group |
470 |
|
@group |
471 |
|
(text-char-description (+ 128 ?\C-m)) |
472 |
|
@result{} "M-^M" |
473 |
|
@end group |
474 |
@end smallexample |
@end smallexample |
475 |
@end defun |
@end defun |
476 |
|
|
477 |
@defun read-kbd-macro string |
@defun read-kbd-macro string &optional need-vector |
478 |
This function is used mainly for operating on keyboard macros, but it |
This function is used mainly for operating on keyboard macros, but it |
479 |
can also be used as a rough inverse for @code{key-description}. You |
can also be used as a rough inverse for @code{key-description}. You |
480 |
call it with a string containing key descriptions, separated by spaces; |
call it with a string containing key descriptions, separated by spaces; |
481 |
it returns a string or vector containing the corresponding events. |
it returns a string or vector containing the corresponding events. |
482 |
(This may or may not be a single valid key sequence, depending on what |
(This may or may not be a single valid key sequence, depending on what |
483 |
events you use; @pxref{Keymap Terminology}.) |
events you use; @pxref{Keymap Terminology}.) If @var{need-vector} is |
484 |
|
non-@code{nil}, the return value is always a vector. |
485 |
@end defun |
@end defun |
486 |
|
|
487 |
@node Help Functions |
@node Help Functions |
493 |
we describe some program-level interfaces to the same information. |
we describe some program-level interfaces to the same information. |
494 |
|
|
495 |
@deffn Command apropos regexp &optional do-all |
@deffn Command apropos regexp &optional do-all |
496 |
This function finds all symbols whose names contain a match for the |
This function finds all ``meaningful'' symbols whose names contain a |
497 |
regular expression @var{regexp}, and returns a list of them |
match for the regular expression @var{regexp}, and returns a list of |
498 |
(@pxref{Regular Expressions}). It also displays the symbols in a buffer |
them, with associated documentation (@pxref{Regular Expressions}). It |
499 |
named @samp{*Help*}, each with a one-line description taken from the |
also displays the symbols in a buffer named @samp{*Apropos*}, each |
500 |
beginning of its documentation string. |
with a one-line description taken from the beginning of its |
501 |
|
documentation string. A symbol is ``meaningful'' if it has a |
502 |
|
definition as a function, variable, or face, or has properties. |
503 |
|
|
504 |
@c Emacs 19 feature |
@c Emacs 19 feature |
505 |
If @var{do-all} is non-@code{nil}, then @code{apropos} also shows key |
If @var{do-all} is non-@code{nil}, or if the user option |
506 |
bindings for the functions that are found; it also shows all symbols, |
@code{apropos-do-all} is non-@code{nil}, then @code{apropos} also |
507 |
even those that are neither functions nor variables. |
shows key bindings for the functions that are found; it also shows |
508 |
|
@emph{all} interned symbols, not just meaningful ones (and it lists |
509 |
In the first of the following examples, @code{apropos} finds all the |
them in the return value as well). |
|
symbols with names containing @samp{exec}. (We don't show here the |
|
|
output that results in the @samp{*Help*} buffer.) |
|
|
|
|
|
@smallexample |
|
|
@group |
|
|
(apropos "exec") |
|
|
@result{} (Buffer-menu-execute command-execute exec-directory |
|
|
exec-path execute-extended-command execute-kbd-macro |
|
|
executing-kbd-macro executing-macro) |
|
|
@end group |
|
|
@end smallexample |
|
510 |
@end deffn |
@end deffn |
511 |
|
|
512 |
@defvar help-map |
@defvar help-map |
521 |
|
|
522 |
@smallexample |
@smallexample |
523 |
@group |
@group |
524 |
(define-key global-map "\C-h" 'help-command) |
(define-key global-map (char-to-string help-char) 'help-command) |
525 |
(fset 'help-command help-map) |
(fset 'help-command help-map) |
526 |
@end group |
@end group |
527 |
@end smallexample |
@end smallexample |
577 |
string that explains what the input is for and how to enter it properly. |
string that explains what the input is for and how to enter it properly. |
578 |
|
|
579 |
Entry to the minibuffer binds this variable to the value of |
Entry to the minibuffer binds this variable to the value of |
580 |
@code{minibuffer-help-form} (@pxref{Minibuffer Misc}). |
@code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}). |
581 |
@end defvar |
@end defvar |
582 |
|
|
583 |
@defvar prefix-help-command |
@defvar prefix-help-command |
616 |
|
|
617 |
@c Emacs 19 feature |
@c Emacs 19 feature |
618 |
@defvar data-directory |
@defvar data-directory |
619 |
|
@anchor{Definition of data-directory} |
620 |
This variable holds the name of the directory in which Emacs finds |
This variable holds the name of the directory in which Emacs finds |
621 |
certain documentation and text files that come with Emacs. In older |
certain documentation and text files that come with Emacs. In older |
622 |
Emacs versions, @code{exec-directory} was used for this. |
Emacs versions, @code{exec-directory} was used for this. |