Fix typos.
[bpt/emacs.git] / doc / lispref / help.texi
CommitLineData
b8d4c8d0
GM
1@c -*-texinfo-*-
2@c This is part of the GNU Emacs Lisp Reference Manual.
73b0cd50 3@c Copyright (C) 1990-1995, 1998-1999, 2001-2011
e9bffc61 4@c Free Software Foundation, Inc.
b8d4c8d0 5@c See the file elisp.texi for copying conditions.
6336d8c3 6@setfilename ../../info/help
b8d4c8d0
GM
7@node Documentation, Files, Modes, Top
8@chapter Documentation
9@cindex documentation strings
10
11 GNU Emacs Lisp has convenient on-line help facilities, most of which
12derive their information from the documentation strings associated with
13functions and variables. This chapter describes how to write good
14documentation strings for your Lisp programs, as well as how to write
15programs to access documentation.
16
17 Note that the documentation strings for Emacs are not the same thing
18as the Emacs manual. Manuals have their own source files, written in
19the Texinfo language; documentation strings are specified in the
20definitions of the functions and variables they apply to. A collection
21of documentation strings is not sufficient as a manual because a good
22manual is not organized in that fashion; it is organized in terms of
23topics of discussion.
24
25 For commands to display documentation strings, see @ref{Help, ,
26Help, emacs, The GNU Emacs Manual}. For the conventions for writing
27documentation strings, see @ref{Documentation Tips}.
28
29@menu
30* Documentation Basics:: Good style for doc strings.
31 Where to put them. How Emacs stores them.
32* Accessing Documentation:: How Lisp programs can access doc strings.
33* Keys in Documentation:: Substituting current key bindings.
34* Describing Characters:: Making printable descriptions of
35 non-printing characters and key sequences.
36* Help Functions:: Subroutines used by Emacs help facilities.
37@end menu
38
39@node Documentation Basics
40@comment node-name, next, previous, up
41@section Documentation Basics
42@cindex documentation conventions
43@cindex writing a documentation string
44@cindex string, writing a doc string
45
46 A documentation string is written using the Lisp syntax for strings,
47with double-quote characters surrounding the text of the string. This
48is because it really is a Lisp string object. The string serves as
49documentation when it is written in the proper place in the definition
50of a function or variable. In a function definition, the documentation
51string follows the argument list. In a variable definition, the
52documentation string follows the initial value of the variable.
53
54 When you write a documentation string, make the first line a
55complete sentence (or two complete sentences) since some commands,
56such as @code{apropos}, show only the first line of a multi-line
57documentation string. Also, you should not indent the second line of
58a documentation string, if it has one, because that looks odd when you
59use @kbd{C-h f} (@code{describe-function}) or @kbd{C-h v}
60(@code{describe-variable}) to view the documentation string. There
61are many other conventions for doc strings; see @ref{Documentation
62Tips}.
63
64 Documentation strings can contain several special substrings, which
65stand for key bindings to be looked up in the current keymaps when the
66documentation is displayed. This allows documentation strings to refer
67to the keys for related commands and be accurate even when a user
68rearranges the key bindings. (@xref{Keys in Documentation}.)
69
70@vindex emacs-lisp-docstring-fill-column
71 Emacs Lisp mode fills documentation strings to the width
72specified by @code{emacs-lisp-docstring-fill-column}.
73
74 In Emacs Lisp, a documentation string is accessible through the
75function or variable that it describes:
76
77@itemize @bullet
78@item
79@kindex function-documentation
80The documentation for a function is usually stored in the function
f2027cdf
LMI
81definition itself (@pxref{Lambda Expressions} and @pxref{Function
82Documentation}). The function @code{documentation} knows how to
83extract it. You can also put function documentation in the
84@code{function-documentation} property of the function name. That is
85useful with definitions such as keyboard macros that can't hold a
86documentation string.
b8d4c8d0
GM
87
88@item
89@kindex variable-documentation
90The documentation for a variable is stored in the variable's property
91list under the property name @code{variable-documentation}. The
92function @code{documentation-property} knows how to retrieve it.
93@end itemize
94
95@cindex @file{DOC-@var{version}} (documentation) file
96To save space, the documentation for preloaded functions and variables
97(including primitive functions and autoloaded functions) is stored in
98the file @file{emacs/etc/DOC-@var{version}}---not inside Emacs. The
99documentation strings for functions and variables loaded during the
100Emacs session from byte-compiled files are stored in those files
101(@pxref{Docs and Compilation}).
102
103The data structure inside Emacs has an integer offset into the file, or
104a list containing a file name and an integer, in place of the
105documentation string. The functions @code{documentation} and
106@code{documentation-property} use that information to fetch the
107documentation string from the appropriate file; this is transparent to
108the user.
109
b8d4c8d0
GM
110@node Accessing Documentation
111@section Access to Documentation Strings
112
113@defun documentation-property symbol property &optional verbatim
114This function returns the documentation string that is recorded in
115@var{symbol}'s property list under property @var{property}. It
116retrieves the text from a file if the value calls for that. If the
117property value isn't @code{nil}, isn't a string, and doesn't refer to
118text in a file, then it is evaluated to obtain a string.
119
120The last thing this function does is pass the string through
121@code{substitute-command-keys} to substitute actual key bindings,
122unless @var{verbatim} is non-@code{nil}.
123
124@smallexample
125@group
126(documentation-property 'command-line-processed
127 'variable-documentation)
128 @result{} "Non-nil once command line has been processed"
129@end group
130@group
131(symbol-plist 'command-line-processed)
132 @result{} (variable-documentation 188902)
133@end group
134@group
135(documentation-property 'emacs 'group-documentation)
136 @result{} "Customization of the One True Editor."
137@end group
138@end smallexample
139@end defun
140
141@defun documentation function &optional verbatim
049bcbcb
CY
142This function returns the documentation string of @var{function}. It
143handles macros, named keyboard macros, and special forms, as well as
144ordinary functions.
b8d4c8d0
GM
145
146If @var{function} is a symbol, this function first looks for the
147@code{function-documentation} property of that symbol; if that has a
148non-@code{nil} value, the documentation comes from that value (if the
149value is not a string, it is evaluated). If @var{function} is not a
150symbol, or if it has no @code{function-documentation} property, then
151@code{documentation} extracts the documentation string from the actual
152function definition, reading it from a file if called for.
153
154Finally, unless @var{verbatim} is non-@code{nil}, it calls
155@code{substitute-command-keys} so as to return a value containing the
156actual (current) key bindings.
157
158The function @code{documentation} signals a @code{void-function} error
159if @var{function} has no function definition. However, it is OK if
160the function definition has no documentation string. In that case,
161@code{documentation} returns @code{nil}.
162@end defun
163
164@defun face-documentation face
165This function returns the documentation string of @var{face} as a
166face.
167@end defun
168
169@c Wordy to prevent overfull hboxes. --rjc 15mar92
170Here is an example of using the two functions, @code{documentation} and
171@code{documentation-property}, to display the documentation strings for
172several symbols in a @samp{*Help*} buffer.
173
174@anchor{describe-symbols example}
175@smallexample
176@group
177(defun describe-symbols (pattern)
178 "Describe the Emacs Lisp symbols matching PATTERN.
179All symbols that have PATTERN in their name are described
180in the `*Help*' buffer."
181 (interactive "sDescribe symbols matching: ")
182 (let ((describe-func
183 (function
184 (lambda (s)
185@end group
186@group
187 ;; @r{Print description of symbol.}
188 (if (fboundp s) ; @r{It is a function.}
189 (princ
190 (format "%s\t%s\n%s\n\n" s
191 (if (commandp s)
192 (let ((keys (where-is-internal s)))
193 (if keys
194 (concat
195 "Keys: "
196 (mapconcat 'key-description
197 keys " "))
198 "Keys: none"))
199 "Function")
200@end group
201@group
202 (or (documentation s)
203 "not documented"))))
204
205 (if (boundp s) ; @r{It is a variable.}
206@end group
207@group
208 (princ
209 (format "%s\t%s\n%s\n\n" s
210 (if (user-variable-p s)
211 "Option " "Variable")
212@end group
213@group
214 (or (documentation-property
215 s 'variable-documentation)
216 "not documented")))))))
217 sym-list)
218@end group
219
220@group
221 ;; @r{Build a list of symbols that match pattern.}
222 (mapatoms (function
223 (lambda (sym)
224 (if (string-match pattern (symbol-name sym))
225 (setq sym-list (cons sym sym-list))))))
226@end group
227
228@group
229 ;; @r{Display the data.}
b2a77f6d
CY
230 (help-setup-xref (list 'describe-symbols pattern) (interactive-p))
231 (with-help-window (help-buffer)
232 (mapcar describe-func (sort sym-list 'string<)))))
b8d4c8d0
GM
233@end group
234@end smallexample
235
236 The @code{describe-symbols} function works like @code{apropos},
237but provides more information.
238
239@smallexample
240@group
241(describe-symbols "goal")
242
243---------- Buffer: *Help* ----------
244goal-column Option
f5c63335 245Semipermanent goal column for vertical motion, as set by @dots{}
b8d4c8d0
GM
246@end group
247@c Do not blithely break or fill these lines.
248@c That makes them incorrect.
249
250@group
251set-goal-column Keys: C-x C-n
252Set the current horizontal position as a goal for C-n and C-p.
253@end group
254@c DO NOT put a blank line here! That is factually inaccurate!
255@group
256Those commands will move to this position in the line moved to
257rather than trying to keep the same horizontal position.
258With a non-nil argument, clears out the goal column
259so that C-n and C-p resume vertical motion.
260The goal column is stored in the variable `goal-column'.
261@end group
262
263@group
264temporary-goal-column Variable
265Current goal column for vertical motion.
266It is the column where point was
267at the start of current run of vertical motion commands.
268When the `track-eol' feature is doing its job, the value is 9999.
269---------- Buffer: *Help* ----------
270@end group
271@end smallexample
272
b8d4c8d0
GM
273@defun Snarf-documentation filename
274@anchor{Definition of Snarf-documentation}
275This function is used only during Emacs initialization, just before
276the runnable Emacs is dumped. It finds the file offsets of the
277documentation strings stored in the file @var{filename}, and records
278them in the in-core function definitions and variable property lists in
279place of the actual strings. @xref{Building Emacs}.
280
281Emacs reads the file @var{filename} from the @file{emacs/etc} directory.
282When the dumped Emacs is later executed, the same file will be looked
283for in the directory @code{doc-directory}. Usually @var{filename} is
284@code{"DOC-@var{version}"}.
285@end defun
286
b8d4c8d0
GM
287@defvar doc-directory
288This variable holds the name of the directory which should contain the
289file @code{"DOC-@var{version}"} that contains documentation strings for
290built-in and preloaded functions and variables.
291
292In most cases, this is the same as @code{data-directory}. They may be
293different when you run Emacs from the directory where you built it,
294without actually installing it. @xref{Definition of data-directory}.
b8d4c8d0
GM
295@end defvar
296
297@node Keys in Documentation
298@section Substituting Key Bindings in Documentation
299@cindex documentation, keys in
300@cindex keys in documentation strings
301@cindex substituting keys in documentation
302
303 When documentation strings refer to key sequences, they should use the
304current, actual key bindings. They can do so using certain special text
305sequences described below. Accessing documentation strings in the usual
306way substitutes current key binding information for these special
307sequences. This works by calling @code{substitute-command-keys}. You
308can also call that function yourself.
309
310 Here is a list of the special sequences and what they mean:
311
312@table @code
313@item \[@var{command}]
314stands for a key sequence that will invoke @var{command}, or @samp{M-x
315@var{command}} if @var{command} has no key bindings.
316
317@item \@{@var{mapvar}@}
318stands for a summary of the keymap which is the value of the variable
319@var{mapvar}. The summary is made using @code{describe-bindings}.
320
321@item \<@var{mapvar}>
322stands for no text itself. It is used only for a side effect: it
323specifies @var{mapvar}'s value as the keymap for any following
324@samp{\[@var{command}]} sequences in this documentation string.
325
326@item \=
4baf28e6
AS
327quotes the following character and is discarded; thus, @samp{\=\[} puts
328@samp{\[} into the output, and @samp{\=\=} puts @samp{\=} into the
329output.
b8d4c8d0
GM
330@end table
331
332@strong{Please note:} Each @samp{\} must be doubled when written in a
333string in Emacs Lisp.
334
335@defun substitute-command-keys string
336This function scans @var{string} for the above special sequences and
337replaces them by what they stand for, returning the result as a string.
338This permits display of documentation that refers accurately to the
339user's own customized key bindings.
340@end defun
341
342 Here are examples of the special sequences:
343
344@smallexample
345@group
346(substitute-command-keys
347 "To abort recursive edit, type: \\[abort-recursive-edit]")
348@result{} "To abort recursive edit, type: C-]"
349@end group
350
351@group
352(substitute-command-keys
353 "The keys that are defined for the minibuffer here are:
354 \\@{minibuffer-local-must-match-map@}")
355@result{} "The keys that are defined for the minibuffer here are:
356@end group
357
358? minibuffer-completion-help
359SPC minibuffer-complete-word
360TAB minibuffer-complete
361C-j minibuffer-complete-and-exit
362RET minibuffer-complete-and-exit
363C-g abort-recursive-edit
364"
365
366@group
367(substitute-command-keys
368 "To abort a recursive edit from the minibuffer, type\
369\\<minibuffer-local-must-match-map>\\[abort-recursive-edit].")
370@result{} "To abort a recursive edit from the minibuffer, type C-g."
371@end group
372@end smallexample
373
374 There are other special conventions for the text in documentation
375strings---for instance, you can refer to functions, variables, and
376sections of this manual. @xref{Documentation Tips}, for details.
377
378@node Describing Characters
379@section Describing Characters for Help Messages
380@cindex describe characters and events
381
382 These functions convert events, key sequences, or characters to
383textual descriptions. These descriptions are useful for including
384arbitrary text characters or key sequences in messages, because they
385convert non-printing and whitespace characters to sequences of printing
386characters. The description of a non-whitespace printing character is
387the character itself.
388
389@defun key-description sequence &optional prefix
390@cindex Emacs event standard notation
391This function returns a string containing the Emacs standard notation
392for the input events in @var{sequence}. If @var{prefix} is
393non-@code{nil}, it is a sequence of input events leading up to
394@var{sequence} and is included in the return value. Both arguments
395may be strings, vectors or lists. @xref{Input Events}, for more
396information about valid events.
397
398@smallexample
399@group
400(key-description [?\M-3 delete])
401 @result{} "M-3 <delete>"
402@end group
403@group
404(key-description [delete] "\M-3")
405 @result{} "M-3 <delete>"
406@end group
407@end smallexample
408
409 See also the examples for @code{single-key-description}, below.
410@end defun
411
412@defun single-key-description event &optional no-angles
413@cindex event printing
414@cindex character printing
415@cindex control character printing
416@cindex meta character printing
417This function returns a string describing @var{event} in the standard
418Emacs notation for keyboard input. A normal printing character
419appears as itself, but a control character turns into a string
420starting with @samp{C-}, a meta character turns into a string starting
421with @samp{M-}, and space, tab, etc.@: appear as @samp{SPC},
422@samp{TAB}, etc. A function key symbol appears inside angle brackets
423@samp{<@dots{}>}. An event that is a list appears as the name of the
424symbol in the @sc{car} of the list, inside angle brackets.
425
426If the optional argument @var{no-angles} is non-@code{nil}, the angle
427brackets around function keys and event symbols are omitted; this is
428for compatibility with old versions of Emacs which didn't use the
429brackets.
430
431@smallexample
432@group
433(single-key-description ?\C-x)
434 @result{} "C-x"
435@end group
436@group
437(key-description "\C-x \M-y \n \t \r \f123")
438 @result{} "C-x SPC M-y SPC C-j SPC TAB SPC RET SPC C-l 1 2 3"
439@end group
440@group
441(single-key-description 'delete)
442 @result{} "<delete>"
443@end group
444@group
445(single-key-description 'C-mouse-1)
446 @result{} "<C-mouse-1>"
447@end group
448@group
449(single-key-description 'C-mouse-1 t)
450 @result{} "C-mouse-1"
451@end group
452@end smallexample
453@end defun
454
455@defun text-char-description character
456This function returns a string describing @var{character} in the
457standard Emacs notation for characters that appear in text---like
458@code{single-key-description}, except that control characters are
459represented with a leading caret (which is how control characters in
460Emacs buffers are usually displayed). Another difference is that
461@code{text-char-description} recognizes the 2**7 bit as the Meta
462character, whereas @code{single-key-description} uses the 2**27 bit
463for Meta.
464
465@smallexample
466@group
467(text-char-description ?\C-c)
468 @result{} "^C"
469@end group
470@group
471(text-char-description ?\M-m)
472 @result{} "\xed"
473@end group
474@group
475(text-char-description ?\C-\M-m)
476 @result{} "\x8d"
477@end group
478@group
479(text-char-description (+ 128 ?m))
480 @result{} "M-m"
481@end group
482@group
483(text-char-description (+ 128 ?\C-m))
484 @result{} "M-^M"
485@end group
486@end smallexample
487@end defun
488
489@defun read-kbd-macro string &optional need-vector
490This function is used mainly for operating on keyboard macros, but it
491can also be used as a rough inverse for @code{key-description}. You
492call it with a string containing key descriptions, separated by spaces;
493it returns a string or vector containing the corresponding events.
494(This may or may not be a single valid key sequence, depending on what
495events you use; @pxref{Key Sequences}.) If @var{need-vector} is
496non-@code{nil}, the return value is always a vector.
497@end defun
498
499@node Help Functions
500@section Help Functions
501
502 Emacs provides a variety of on-line help functions, all accessible to
503the user as subcommands of the prefix @kbd{C-h}. For more information
504about them, see @ref{Help, , Help, emacs, The GNU Emacs Manual}. Here
505we describe some program-level interfaces to the same information.
506
507@deffn Command apropos pattern &optional do-all
508This function finds all ``meaningful'' symbols whose names contain a
509match for the apropos pattern @var{pattern}. An apropos pattern is
510either a word to match, a space-separated list of words of which at
511least two must match, or a regular expression (if any special regular
512expression characters occur). A symbol is ``meaningful'' if it has a
513definition as a function, variable, or face, or has properties.
514
515The function returns a list of elements that look like this:
516
517@example
518(@var{symbol} @var{score} @var{fn-doc} @var{var-doc}
519 @var{plist-doc} @var{widget-doc} @var{face-doc} @var{group-doc})
520@end example
521
522Here, @var{score} is an integer measure of how important the symbol
523seems to be as a match, and the remaining elements are documentation
524strings for @var{symbol}'s various roles (or @code{nil}).
525
526It also displays the symbols in a buffer named @samp{*Apropos*}, each
527with a one-line description taken from the beginning of its
528documentation string.
529
b8d4c8d0
GM
530If @var{do-all} is non-@code{nil}, or if the user option
531@code{apropos-do-all} is non-@code{nil}, then @code{apropos} also
532shows key bindings for the functions that are found; it also shows
533@emph{all} interned symbols, not just meaningful ones (and it lists
534them in the return value as well).
535@end deffn
536
537@defvar help-map
538The value of this variable is a local keymap for characters following the
539Help key, @kbd{C-h}.
540@end defvar
541
542@deffn {Prefix Command} help-command
543This symbol is not a function; its function definition cell holds the
544keymap known as @code{help-map}. It is defined in @file{help.el} as
545follows:
546
547@smallexample
548@group
3e99b825 549(define-key global-map (string help-char) 'help-command)
b8d4c8d0
GM
550(fset 'help-command help-map)
551@end group
552@end smallexample
553@end deffn
554
01f17ae2 555@defopt help-char
b8d4c8d0
GM
556The value of this variable is the help character---the character that
557Emacs recognizes as meaning Help. By default, its value is 8, which
558stands for @kbd{C-h}. When Emacs reads this character, if
559@code{help-form} is a non-@code{nil} Lisp expression, it evaluates that
560expression, and displays the result in a window if it is a string.
561
562Usually the value of @code{help-form} is @code{nil}. Then the
563help character has no special meaning at the level of command input, and
564it becomes part of a key sequence in the normal way. The standard key
565binding of @kbd{C-h} is a prefix key for several general-purpose help
566features.
567
568The help character is special after prefix keys, too. If it has no
569binding as a subcommand of the prefix key, it runs
570@code{describe-prefix-bindings}, which displays a list of all the
571subcommands of the prefix key.
01f17ae2 572@end defopt
b8d4c8d0 573
01f17ae2 574@defopt help-event-list
b8d4c8d0
GM
575The value of this variable is a list of event types that serve as
576alternative ``help characters.'' These events are handled just like the
577event specified by @code{help-char}.
01f17ae2 578@end defopt
b8d4c8d0
GM
579
580@defvar help-form
581If this variable is non-@code{nil}, its value is a form to evaluate
582whenever the character @code{help-char} is read. If evaluating the form
583produces a string, that string is displayed.
584
585A command that calls @code{read-event} or @code{read-char} probably
586should bind @code{help-form} to a non-@code{nil} expression while it
587does input. (The time when you should not do this is when @kbd{C-h} has
588some other meaning.) Evaluating this expression should result in a
589string that explains what the input is for and how to enter it properly.
590
591Entry to the minibuffer binds this variable to the value of
592@code{minibuffer-help-form} (@pxref{Definition of minibuffer-help-form}).
593@end defvar
594
595@defvar prefix-help-command
596This variable holds a function to print help for a prefix key. The
597function is called when the user types a prefix key followed by the help
598character, and the help character has no binding after that prefix. The
599variable's default value is @code{describe-prefix-bindings}.
600@end defvar
601
602@defun describe-prefix-bindings
603This function calls @code{describe-bindings} to display a list of all
604the subcommands of the prefix key of the most recent key sequence. The
605prefix described consists of all but the last event of that key
606sequence. (The last event is, presumably, the help character.)
607@end defun
608
609 The following two functions are meant for modes that want to provide
610help without relinquishing control, such as the ``electric'' modes.
611Their names begin with @samp{Helper} to distinguish them from the
612ordinary help functions.
613
614@deffn Command Helper-describe-bindings
615This command pops up a window displaying a help buffer containing a
616listing of all of the key bindings from both the local and global keymaps.
617It works by calling @code{describe-bindings}.
618@end deffn
619
620@deffn Command Helper-help
621This command provides help for the current mode. It prompts the user
622in the minibuffer with the message @samp{Help (Type ? for further
623options)}, and then provides assistance in finding out what the key
624bindings are, and what the mode is intended for. It returns @code{nil}.
625
626This can be customized by changing the map @code{Helper-help-map}.
627@end deffn
628
b8d4c8d0
GM
629@defvar data-directory
630@anchor{Definition of data-directory}
631This variable holds the name of the directory in which Emacs finds
bbe45ef7 632certain documentation and text files that come with Emacs.
b8d4c8d0
GM
633@end defvar
634
77c7e2e1 635@defun help-buffer
b2a77f6d
CY
636This function returns the name of the help buffer, which is normally
637@samp{*Help*}; if such a buffer does not exist, it is first created.
77c7e2e1 638@end defun
b2a77f6d
CY
639
640@defmac with-help-window buffer-name body@dots{}
641This macro evaluates the @var{body} forms, inserting any output they
642produce into a buffer named @var{buffer-name} like
643@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}).
644(Usually, @var{buffer-name} should be the value returned by the
645function @code{help-buffer}.) It also puts the specified buffer into
646Help mode and displays a message telling the user how to quit and
647scroll the help window.
648@end defmac
649
77c7e2e1 650@defun help-setup-xref item interactive-p
b2a77f6d
CY
651This function updates the cross reference data in the @samp{*Help*}
652buffer, which is used to regenerate the help information when the user
653clicks on the @samp{Back} or @samp{Forward} buttons. Most commands
654that use the @samp{*Help*} buffer should invoke this function before
655clearing the buffer. The @var{item} argument should have the form
cd1181db 656@code{(@var{function} . @var{args})}, where @var{function} is a function
b2a77f6d
CY
657to call, with argument list @var{args}, to regenerate the help buffer.
658The @var{interactive-p} argument is non-@code{nil} if the calling
659command was invoked interactively; in that case, the stack of items
660for the @samp{*Help*} buffer's @samp{Back} buttons is cleared.
77c7e2e1 661@end defun
b2a77f6d
CY
662
663@xref{describe-symbols example}, for an example of using
664@code{help-buffer}, @code{with-help-window}, and
665@code{help-setup-xref}.
666
b8d4c8d0
GM
667@defmac make-help-screen fname help-line help-text help-map
668This macro defines a help command named @var{fname} that acts like a
669prefix key that shows a list of the subcommands it offers.
670
671When invoked, @var{fname} displays @var{help-text} in a window, then
672reads and executes a key sequence according to @var{help-map}. The
673string @var{help-text} should describe the bindings available in
674@var{help-map}.
675
676The command @var{fname} is defined to handle a few events itself, by
677scrolling the display of @var{help-text}. When @var{fname} reads one of
678those special events, it does the scrolling and then reads another
679event. When it reads an event that is not one of those few, and which
680has a binding in @var{help-map}, it executes that key's binding and
681then returns.
682
683The argument @var{help-line} should be a single-line summary of the
684alternatives in @var{help-map}. In the current version of Emacs, this
685argument is used only if you set the option @code{three-step-help} to
686@code{t}.
687
688This macro is used in the command @code{help-for-help} which is the
689binding of @kbd{C-h C-h}.
690@end defmac
691
692@defopt three-step-help
693If this variable is non-@code{nil}, commands defined with
694@code{make-help-screen} display their @var{help-line} strings in the
695echo area at first, and display the longer @var{help-text} strings only
696if the user types the help character again.
697@end defopt
698