aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2009-03-30 21:57:28 +0000
committerChong Yidong2009-03-30 21:57:28 +0000
commitb2a77f6dc3775ec8d4e6d1dbb1ca6df85fe772df (patch)
treed0cf13da10fe2ad87aff83267a00683841a6b129
parent4bbe48ec136bfb36f11c9c5bb9bbf9b88860367a (diff)
downloademacs-b2a77f6dc3775ec8d4e6d1dbb1ca6df85fe772df.tar.gz
emacs-b2a77f6dc3775ec8d4e6d1dbb1ca6df85fe772df.zip
(Accessing Documentation): Update example to use
help-setup-xref and with-help-window. (Help Functions): Remove print-help-return-message, which is semi-obsolete due to with-help-window. Document help-buffer and help-setup-xref.
-rw-r--r--doc/lispref/help.texi63
1 files changed, 35 insertions, 28 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 8d237eeb899..b6210da7f99 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -232,9 +232,9 @@ in the `*Help*' buffer."
232 232
233@group 233@group
234 ;; @r{Display the data.} 234 ;; @r{Display the data.}
235 (with-output-to-temp-buffer "*Help*" 235 (help-setup-xref (list 'describe-symbols pattern) (interactive-p))
236 (mapcar describe-func (sort sym-list 'string<)) 236 (with-help-window (help-buffer)
237 (print-help-return-message)))) 237 (mapcar describe-func (sort sym-list 'string<)))))
238@end group 238@end group
239@end smallexample 239@end smallexample
240 240
@@ -557,19 +557,6 @@ follows:
557@end smallexample 557@end smallexample
558@end deffn 558@end deffn
559 559
560@defun print-help-return-message &optional function
561This function builds a string that explains how to restore the previous
562state of the windows after a help command. After building the message,
563it applies @var{function} to it if @var{function} is non-@code{nil}.
564Otherwise it calls @code{message} to display it in the echo area.
565
566This function expects to be called inside a
567@code{with-output-to-temp-buffer} special form, and expects
568@code{standard-output} to have the value bound by that special form.
569For an example of its use, see the long example in @ref{Accessing
570Documentation}.
571@end defun
572
573@defvar help-char 560@defvar help-char
574The value of this variable is the help character---the character that 561The value of this variable is the help character---the character that
575Emacs recognizes as meaning Help. By default, its value is 8, which 562Emacs recognizes as meaning Help. By default, its value is 8, which
@@ -650,6 +637,38 @@ This variable holds the name of the directory in which Emacs finds
650certain documentation and text files that come with Emacs. 637certain documentation and text files that come with Emacs.
651@end defvar 638@end defvar
652 639
640@deffn help-buffer
641This function returns the name of the help buffer, which is normally
642@samp{*Help*}; if such a buffer does not exist, it is first created.
643@end deffn
644
645@defmac with-help-window buffer-name body@dots{}
646This macro evaluates the @var{body} forms, inserting any output they
647produce into a buffer named @var{buffer-name} like
648@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}).
649(Usually, @var{buffer-name} should be the value returned by the
650function @code{help-buffer}.) It also puts the specified buffer into
651Help mode and displays a message telling the user how to quit and
652scroll the help window.
653@end defmac
654
655@deffn help-setup-xref item interactive-p
656This function updates the cross reference data in the @samp{*Help*}
657buffer, which is used to regenerate the help information when the user
658clicks on the @samp{Back} or @samp{Forward} buttons. Most commands
659that use the @samp{*Help*} buffer should invoke this function before
660clearing the buffer. The @var{item} argument should have the form
661@code{(@var{funtion} . @var{args})}, where @var{funtion} is a function
662to call, with argument list @var{args}, to regenerate the help buffer.
663The @var{interactive-p} argument is non-@code{nil} if the calling
664command was invoked interactively; in that case, the stack of items
665for the @samp{*Help*} buffer's @samp{Back} buttons is cleared.
666@end deffn
667
668@xref{describe-symbols example}, for an example of using
669@code{help-buffer}, @code{with-help-window}, and
670@code{help-setup-xref}.
671
653@defmac make-help-screen fname help-line help-text help-map 672@defmac make-help-screen fname help-line help-text help-map
654This macro defines a help command named @var{fname} that acts like a 673This macro defines a help command named @var{fname} that acts like a
655prefix key that shows a list of the subcommands it offers. 674prefix key that shows a list of the subcommands it offers.
@@ -675,18 +694,6 @@ This macro is used in the command @code{help-for-help} which is the
675binding of @kbd{C-h C-h}. 694binding of @kbd{C-h C-h}.
676@end defmac 695@end defmac
677 696
678@defmac with-help-window buffer-name body@dots{}
679This macro evaluates the @var{body} forms, inserting any output they
680produce into a buffer named @var{buffer-name} like
681@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}). It
682also puts that buffer in Help mode, displays a message telling the
683user how to quit and scroll the help window, and does various other
684things that make a help window work better.
685
686Don't use @code{print-help-return-message} in the body of this macro;
687it would cause bad results.
688@end defmac
689
690@defopt three-step-help 697@defopt three-step-help
691If this variable is non-@code{nil}, commands defined with 698If this variable is non-@code{nil}, commands defined with
692@code{make-help-screen} display their @var{help-line} strings in the 699@code{make-help-screen} display their @var{help-line} strings in the