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