diff options
| author | Chong Yidong | 2009-03-30 21:57:28 +0000 |
|---|---|---|
| committer | Chong Yidong | 2009-03-30 21:57:28 +0000 |
| commit | b2a77f6dc3775ec8d4e6d1dbb1ca6df85fe772df (patch) | |
| tree | d0cf13da10fe2ad87aff83267a00683841a6b129 | |
| parent | 4bbe48ec136bfb36f11c9c5bb9bbf9b88860367a (diff) | |
| download | emacs-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.texi | 63 |
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 | ||
| 561 | This function builds a string that explains how to restore the previous | ||
| 562 | state of the windows after a help command. After building the message, | ||
| 563 | it applies @var{function} to it if @var{function} is non-@code{nil}. | ||
| 564 | Otherwise it calls @code{message} to display it in the echo area. | ||
| 565 | |||
| 566 | This 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. | ||
| 569 | For an example of its use, see the long example in @ref{Accessing | ||
| 570 | Documentation}. | ||
| 571 | @end defun | ||
| 572 | |||
| 573 | @defvar help-char | 560 | @defvar help-char |
| 574 | The value of this variable is the help character---the character that | 561 | The value of this variable is the help character---the character that |
| 575 | Emacs recognizes as meaning Help. By default, its value is 8, which | 562 | Emacs 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 | |||
| 650 | certain documentation and text files that come with Emacs. | 637 | certain documentation and text files that come with Emacs. |
| 651 | @end defvar | 638 | @end defvar |
| 652 | 639 | ||
| 640 | @deffn help-buffer | ||
| 641 | This 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{} | ||
| 646 | This macro evaluates the @var{body} forms, inserting any output they | ||
| 647 | produce 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 | ||
| 650 | function @code{help-buffer}.) It also puts the specified buffer into | ||
| 651 | Help mode and displays a message telling the user how to quit and | ||
| 652 | scroll the help window. | ||
| 653 | @end defmac | ||
| 654 | |||
| 655 | @deffn help-setup-xref item interactive-p | ||
| 656 | This function updates the cross reference data in the @samp{*Help*} | ||
| 657 | buffer, which is used to regenerate the help information when the user | ||
| 658 | clicks on the @samp{Back} or @samp{Forward} buttons. Most commands | ||
| 659 | that use the @samp{*Help*} buffer should invoke this function before | ||
| 660 | clearing the buffer. The @var{item} argument should have the form | ||
| 661 | @code{(@var{funtion} . @var{args})}, where @var{funtion} is a function | ||
| 662 | to call, with argument list @var{args}, to regenerate the help buffer. | ||
| 663 | The @var{interactive-p} argument is non-@code{nil} if the calling | ||
| 664 | command was invoked interactively; in that case, the stack of items | ||
| 665 | for 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 |
| 654 | This macro defines a help command named @var{fname} that acts like a | 673 | This macro defines a help command named @var{fname} that acts like a |
| 655 | prefix key that shows a list of the subcommands it offers. | 674 | prefix 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 | |||
| 675 | binding of @kbd{C-h C-h}. | 694 | binding of @kbd{C-h C-h}. |
| 676 | @end defmac | 695 | @end defmac |
| 677 | 696 | ||
| 678 | @defmac with-help-window buffer-name body@dots{} | ||
| 679 | This macro evaluates the @var{body} forms, inserting any output they | ||
| 680 | produce into a buffer named @var{buffer-name} like | ||
| 681 | @code{with-output-to-temp-buffer} (@pxref{Temporary Displays}). It | ||
| 682 | also puts that buffer in Help mode, displays a message telling the | ||
| 683 | user how to quit and scroll the help window, and does various other | ||
| 684 | things that make a help window work better. | ||
| 685 | |||
| 686 | Don't use @code{print-help-return-message} in the body of this macro; | ||
| 687 | it would cause bad results. | ||
| 688 | @end defmac | ||
| 689 | |||
| 690 | @defopt three-step-help | 697 | @defopt three-step-help |
| 691 | If this variable is non-@code{nil}, commands defined with | 698 | If 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 |