Undoing the changes erroneously committed just before.
[bpt/emacs.git] / lispref / help.texi
index 396d11b..eeb8d99 100644 (file)
@@ -1,6 +1,7 @@
 @c -*-texinfo-*-
 @c This is part of the GNU Emacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1998, 1999
+@c   Free Software Foundation, Inc. 
 @c See the file elisp.texi for copying conditions.
 @setfilename ../info/help
 @node Documentation, Files, Modes, Top
@@ -50,30 +51,30 @@ documentation string follows the initial value of the variable.
 sentence (or two complete sentences) since some commands, such as
 @code{apropos}, show only the first line of a multi-line documentation
 string.  Also, you should not indent the second line of a documentation
-string, if you have one, because that looks odd when you use @kbd{C-h f}
-(@code{describe-function}) or @kbd{C-h v} (@code{describe-variable}).
-@xref{Documentation Tips}.
+string, if it has one, because that looks odd when you use @kbd{C-h f}
+(@code{describe-function}) or @kbd{C-h v} (@code{describe-variable}) to
+view the documentation string.  @xref{Documentation Tips}.
 
-  Documentation strings may contain several special substrings, which
+  Documentation strings can contain several special substrings, which
 stand for key bindings to be looked up in the current keymaps when the
 documentation is displayed.  This allows documentation strings to refer
 to the keys for related commands and be accurate even when a user
 rearranges the key bindings.  (@xref{Accessing Documentation}.)
 
-  Within the Lisp world, a documentation string is kept with the
+  In Emacs Lisp, a documentation string is accessible through the
 function or variable that it describes:
 
 @itemize @bullet
 @item
 The documentation for a function is stored in the function definition
-itself (@pxref{Lambda Expressions}).  The function
-@code{documentation} knows how to extract it.
+itself (@pxref{Lambda Expressions}).  The function @code{documentation}
+knows how to extract it.
 
 @item
 @kindex variable-documentation
 The documentation for a variable is stored in the variable's property
 list under the property name @code{variable-documentation}.  The
-function @code{documentation-property} knows how to extract it.
+function @code{documentation-property} knows how to retrieve it.
 @end itemize
 
 @cindex @file{DOC} (documentation) file
@@ -81,14 +82,17 @@ function @code{documentation-property} knows how to extract it.
 @cindex @file{etc/DOC-@var{version}}
 To save space, the documentation for preloaded functions and variables
 (including primitive functions and autoloaded functions) is stored in
-the file @file{emacs/etc/DOC-@var{version}}.  The data structure inside
-Emacs has an integer offset into the file, where the documentation
-string ought to be.  The functions @code{documentation} and
-@code{documentation-property} read the documentation from the file
-@file{emacs/etc/DOC-@var{version}} when they notice the integer there;
-this is transparent to the user.  Keeping the documentation strings out
-of the Emacs core image saves a significant amount of space.
-@xref{Building Emacs}.
+the file @file{emacs/etc/DOC-@var{version}}---not inside Emacs.  The
+documentation strings for functions and variables loaded during the
+Emacs session from byte-compiled files are stored in those files
+(@pxref{Docs and Compilation}).
+
+The data structure inside Emacs has an integer offset into the file, or
+a list containing a file name and an integer, in place of the
+documentation string.  The functions @code{documentation} and
+@code{documentation-property} use that information to fetch the
+documentation string from the appropriate file; this is transparent to
+the user.
 
   For information on the uses of documentation strings, see @ref{Help, ,
 Help, emacs, The GNU Emacs Manual}.
@@ -96,25 +100,24 @@ Help, emacs, The GNU Emacs Manual}.
 @c Wordy to prevent overfull hbox.  --rjc 15mar92
   The @file{emacs/lib-src} directory contains two utilities that you can
 use to print nice-looking hardcopy for the file
-@file{emacs/etc/DOC-@var{version}}.  These are @file{sorted-doc.c} and
-@file{digest-doc.c}.
+@file{emacs/etc/DOC-@var{version}}.  These are @file{sorted-doc} and
+@file{digest-doc}.
 
 @node Accessing Documentation
 @section Access to Documentation Strings
 
 @defun documentation-property symbol property &optional verbatim
 This function returns the documentation string that is recorded
-@var{symbol}'s property list under property @var{property}.  It
-retrieves the text from the file @file{emacs/etc/DOC-@var{version}} if
-necessary, and runs @code{substitute-command-keys} to substitute actual
-key bindings.  (This substitution is not done if @var{verbatim} is
-non-@code{nil}; the @var{verbatim} argument exists only as of Emacs 19.)
+in @var{symbol}'s property list under property @var{property}.  It
+retrieves the text from a file if necessary, and runs
+@code{substitute-command-keys} to substitute actual key bindings.  (This
+substitution is not done if @var{verbatim} is non-@code{nil}.)
 
 @smallexample
 @group
 (documentation-property 'command-line-processed
    'variable-documentation)
-     @result{} "t once command line has been processed"
+     @result{} "Non-nil once command line has been processed"
 @end group
 @group
 (symbol-plist 'command-line-processed)
@@ -124,17 +127,13 @@ non-@code{nil}; the @var{verbatim} argument exists only as of Emacs 19.)
 @end defun
 
 @defun documentation function &optional verbatim
-This function returns the documentation string of @var{function}.
-This function will access the documentation string if it is stored in
-the @file{emacs/etc/DOC-@var{version}} file.
-
-In addition, @code{documentation} runs @code{substitute-command-keys}
-on the resulting string, so the value contains the actual (current) key
-bindings.  (This is not done if @var{verbatim} is non-@code{nil}; the
-@var{verbatim} argument exists only as of Emacs 19.)
+This function returns the documentation string of @var{function}.  It
+reads the text from a file if necessary.  Then (unless @var{verbatim} is
+non-@code{nil}) it calls @code{substitute-command-keys}, to return a
+value containing the actual (current) key bindings.
 
 The function @code{documentation} signals a @code{void-function} error
-if @var{function} has no function definition.  However, it is ok if
+if @var{function} has no function definition.  However, it is OK if
 the function definition has no documentation string.  In that case,
 @code{documentation} returns @code{nil}.
 @end defun
@@ -214,13 +213,13 @@ but provides more information.
 
 ---------- Buffer: *Help* ----------
 goal-column     Option 
-*Semipermanent goal column for vertical motion, as set by C-x C-n, or nil.
+*Semipermanent goal column for vertical motion, as set by @dots{}
 @end group
 @c Do not blithely break or fill these lines.
 @c That makes them incorrect.
 
 @group
-set-goal-column Command: C-x C-n
+set-goal-column Keys: C-x C-n
 Set the current horizontal position as a goal for C-n and C-p.
 @end group
 @c DO NOT put a blank line here!  That is factually inaccurate!
@@ -242,22 +241,27 @@ When the `track-eol' feature is doing its job, the value is 9999.
 @end group
 @end smallexample
 
+The asterisk @samp{*} as the first character of a variable's doc string,
+as shown above for the @code{goal-column} variable, means that it is a
+user option; see the description of @code{defvar} in @ref{Defining
+Variables}.
+
 @defun Snarf-documentation filename
-  This function is used only during Emacs initialization, just before
+This function is used only during Emacs initialization, just before
 the runnable Emacs is dumped.  It finds the file offsets of the
 documentation strings stored in the file @var{filename}, and records
 them in the in-core function definitions and variable property lists in
 place of the actual strings.  @xref{Building Emacs}.
 
-  Emacs finds the file @var{filename} in the @file{emacs/etc} directory.
-When the dumped Emacs is later executed, the same file is found in the
-directory @code{doc-directory}.  Usually @var{filename} is
+Emacs reads the file @var{filename} from the @file{emacs/etc} directory.
+When the dumped Emacs is later executed, the same file will be looked
+for in the directory @code{doc-directory}.  Usually @var{filename} is
 @code{"DOC-@var{version}"}.
 @end defun
 
 @c Emacs 19 feature
 @defvar doc-directory
-This variable holds the name of the directory which should contion the
+This variable holds the name of the directory which should contain the
 file @code{"DOC-@var{version}"} that contains documentation strings for
 built-in and preloaded functions and variables.
 
@@ -290,13 +294,18 @@ stands for a key sequence that will invoke @var{command}, or @samp{M-x
 @var{command}} if @var{command} has no key bindings.
 
 @item \@{@var{mapvar}@} 
-stands for a summary of the value of @var{mapvar}, which should be a
-keymap.  The summary is made by @code{describe-bindings}.
+stands for a summary of the keymap which is the value of the variable
+@var{mapvar}.  The summary is made using @code{describe-bindings}.
 
 @item \<@var{mapvar}> 
-stands for no text itself.  It is used for a side effect: it specifies
-@var{mapvar} as the keymap for any following @samp{\[@var{command}]}
-sequences in this documentation string.
+stands for no text itself.  It is used only for a side effect: it
+specifies @var{mapvar}'s value as the keymap for any following
+@samp{\[@var{command}]} sequences in this documentation string.
+
+@item \=
+quotes the following character and is discarded; thus, @samp{\=\[} puts
+@samp{\[} into the output, and @samp{\=\=} puts @samp{\=} into the
+output.
 @end table
 
 @strong{Please note:} Each @samp{\} must be doubled when written in a
@@ -328,7 +337,7 @@ user's own customized key bindings.
 ?               minibuffer-completion-help
 SPC             minibuffer-complete-word
 TAB             minibuffer-complete
-LFD             minibuffer-complete-and-exit
+C-j             minibuffer-complete-and-exit
 RET             minibuffer-complete-and-exit
 C-g             abort-recursive-edit
 "
@@ -344,10 +353,10 @@ C-g             abort-recursive-edit
 @node Describing Characters
 @section Describing Characters for Help Messages
 
-  These functions convert events, key sequences or characters to textual
-descriptions.  These descriptions are useful for including arbitrary
-text characters or key sequences in messages, because they convert
-non-printing and whitespace characters to sequences of printing
+  These functions convert events, key sequences, or characters to
+textual descriptions.  These descriptions are useful for including
+arbitrary text characters or key sequences in messages, because they
+convert non-printing and whitespace characters to sequences of printing
 characters.  The description of a non-whitespace printing character is
 the character itself.
 
@@ -369,7 +378,7 @@ This function returns a string describing @var{event} in the standard
 Emacs notation for keyboard input.  A normal printing character appears
 as itself, but a control character turns into a string starting with
 @samp{C-}, a meta character turns into a string starting with @samp{M-},
-and space, linefeed, etc.@: appear as @samp{SPC}, @samp{LFD}, etc.  A
+and space, tab, etc.@: appear as @samp{SPC}, @samp{TAB}, etc.  A
 function key symbol appears as itself.  An event that is a list appears
 as the name of the symbol in the @sc{car} of the list.
 
@@ -380,7 +389,7 @@ as the name of the symbol in the @sc{car} of the list.
 @end group
 @group
 (key-description "\C-x \M-y \n \t \r \f123")
-     @result{} "C-x SPC M-y SPC LFD SPC TAB SPC RET SPC C-l 1 2 3"
+     @result{} "C-x SPC M-y SPC C-j SPC TAB SPC RET SPC C-l 1 2 3"
 @end group
 @group
 (single-key-description 'C-mouse-1)
@@ -412,6 +421,15 @@ Emacs buffers are usually displayed).
 @end smallexample
 @end defun
 
+@defun read-kbd-macro string
+This function is used mainly for operating on keyboard macros, but it
+can also be used as a rough inverse for @code{key-description}.  You
+call it with a string containing key descriptions, separated by spaces;
+it returns a string or vector containing the corresponding events.
+(This may or may not be a single valid key sequence, depending on what
+events you use; @pxref{Keymap Terminology}.)
+@end defun
+
 @node Help Functions
 @section Help Functions
 
@@ -420,25 +438,21 @@ the user as subcommands of the prefix @kbd{C-h}.  For more information
 about them, see @ref{Help, , Help, emacs, The GNU Emacs Manual}.  Here
 we describe some program-level interfaces to the same information.
 
-@deffn Command apropos regexp &optional do-all predicate
+@deffn Command apropos regexp &optional do-all
 This function finds all symbols whose names contain a match for the
 regular expression @var{regexp}, and returns a list of them
 (@pxref{Regular Expressions}).  It also displays the symbols in a buffer
-named @samp{*Help*}, each with a one-line description.
+named @samp{*Help*}, each with a one-line description taken from the
+beginning of its documentation string.
 
 @c Emacs 19 feature
-If @var{do-all} is non-@code{nil}, then @code{apropos} also shows
-key bindings for the functions that are found.
-
-If @var{predicate} is non-@code{nil}, it should be a function to be
-called on each symbol that has matched @var{regexp}.  Only symbols for
-which @var{predicate} returns a non-@code{nil} value are listed or
-displayed.
+If @var{do-all} is non-@code{nil}, then @code{apropos} also shows key
+bindings for the functions that are found; it also shows all symbols,
+even those that are neither functions nor variables.
 
 In the first of the following examples, @code{apropos} finds all the
-symbols with names containing @samp{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 @samp{*Help*} buffer.)
+symbols with names containing @samp{exec}.  (We don't show here the
+output that results in the @samp{*Help*} buffer.)
 
 @smallexample
 @group
@@ -447,51 +461,16 @@ finds and returns only those symbols that are also commands.
     exec-path execute-extended-command execute-kbd-macro
     executing-kbd-macro executing-macro)
 @end group
-
-@group
-(apropos "exec" nil 'commandp)
-     @result{} (Buffer-menu-execute execute-extended-command)
-@end group
-@ignore
-@group
----------- Buffer: *Help* ----------
-Buffer-menu-execute
-  Function: Save and/or delete buffers marked with
-  M-x Buffer-menu-save or M-x Buffer-menu-delete commands.
-execute-extended-command      ESC x
-  Function: Read function name, then read its 
-  arguments and call it.
----------- Buffer: *Help* ----------
-@end group
-@end ignore
-@end smallexample
-
-The command @kbd{C-h a} (@code{command-apropos}) calls @code{apropos},
-but specifies a @var{predicate} to restrict the output to symbols that
-are commands.  The call to @code{apropos} looks like this:
-
-@smallexample
-(apropos string t 'commandp)
 @end smallexample
 @end deffn
 
-@c Emacs 19 feature
-@deffn Command super-apropos regexp &optional do-all
-This function differs from @code{apropos} in that it searches
-documentation strings as well as symbol names for matches for
-@var{regexp}.  By default, it searches the documentation strings only
-for preloaded functions and variables.  If @var{do-all} is
-non-@code{nil}, it scans the names and documentation strings of all
-functions and variables.
-@end deffn
-
 @defvar help-map
 The value of this variable is a local keymap for characters following the
 Help key, @kbd{C-h}.
 @end defvar
 
 @deffn {Prefix Command} help-command
-This symbol is not a function; its function definition is actually the
+This symbol is not a function; its function definition cell holds the
 keymap known as @code{help-map}.  It is defined in @file{help.el} as
 follows:
 
@@ -518,12 +497,12 @@ Documentation}.
 
 @defvar help-char
 The value of this variable is the help character---the character that
-Emacs recognizes as meaning Help.  By default, it is 8, which is
-@kbd{C-h}.  When Emacs reads this character, if @code{help-form} is
-non-@code{nil} Lisp expression, it evaluates that expression, and
-displays the result in a window if it is a string.
+Emacs recognizes as meaning Help.  By default, its value is 8, which
+stands for @kbd{C-h}.  When Emacs reads this character, if
+@code{help-form} is a non-@code{nil} Lisp expression, it evaluates that
+expression, and displays the result in a window if it is a string.
 
-Usually the value of @code{help-form}'s value is @code{nil}.  Then the
+Usually the value of @code{help-form} is @code{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 @kbd{C-h} is a prefix key for several general-purpose help
@@ -535,6 +514,12 @@ binding as a subcommand of the prefix key, it runs
 subcommands of the prefix key.
 @end defvar
 
+@defvar help-event-list
+The value of this variable is a list of event types that serve as
+alternative ``help characters.''  These events are handled just like the
+event specified by @code{help-char}.
+@end defvar
+
 @defvar help-form
 If this variable is non-@code{nil}, its value is a form to evaluate
 whenever the character @code{help-char} is read.  If evaluating the form
@@ -542,19 +527,19 @@ produces a string, that string is displayed.
 
 A command that calls @code{read-event} or @code{read-char} probably
 should bind @code{help-form} to a non-@code{nil} expression while it
-does input.  (The exception is when @kbd{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.
+does input.  (The time when you should not do this is when @kbd{C-h} has
+some other meaning.)  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
 @code{minibuffer-help-form} (@pxref{Minibuffer Misc}).
 @end defvar
 
 @defvar prefix-help-command
-This variable holds a function to print help for a prefix character.
-The function is called when the user types a prefix key followed by the
-help character, and the help character has no binding after that prefix.
-The variable's default value is @code{describe-prefix-bindings}.
+This variable holds a function to print help for a prefix key.  The
+function is called when the user types a prefix key followed by the help
+character, and the help character has no binding after that prefix.  The
+variable's default value is @code{describe-prefix-bindings}.
 @end defvar
 
 @defun describe-prefix-bindings
@@ -564,11 +549,10 @@ prefix described consists of all but the last event of that key
 sequence.  (The last event is, presumably, the help character.)
 @end defun
 
-  The following two functions are found in the library @file{helper}.
-They are for modes that want to provide help without relinquishing
-control, such as the ``electric'' modes.  You must load that library
-with @code{(require 'helper)} in order to use them.  Their names begin
-with @samp{Helper} to distinguish them from the ordinary help functions.
+  The following two functions are meant for modes that want to provide
+help without relinquishing control, such as the ``electric'' modes.
+Their names begin with @samp{Helper} to distinguish them from the
+ordinary help functions.
 
 @deffn Command Helper-describe-bindings
 This command pops up a window displaying a help buffer containing a
@@ -613,6 +597,9 @@ The argument @var{help-line} should be a single-line summary of the
 alternatives in @var{help-map}.  In the current version of Emacs, this
 argument is used only if you set the option @code{three-step-help} to
 @code{t}.
+
+This macro is used in the command @code{help-for-help} which is the
+binding of @kbd{C-h C-h}.
 @end defmac
 
 @defopt three-step-help