aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Helm2018-03-18 21:05:44 +1300
committerEli Zaretskii2018-03-20 14:19:14 +0200
commit2fb52abd9e74f722c08c5e59f63dee8821789e1a (patch)
treea7d20dff222e9077f40ac7b7587abb192bd3649c
parentec08c62f036c3c86f1e00d54a47c405299a19993 (diff)
downloademacs-2fb52abd9e74f722c08c5e59f63dee8821789e1a.tar.gz
emacs-2fb52abd9e74f722c08c5e59f63dee8821789e1a.zip
Improve documentation of 'with-help-window'
* doc/lispref/help.texi (Help Functions): Change variable name to 'buffer-or-name'. * lisp/help.el (with-help-window): Change variable name to 'buffer-or-name' and rewrite the doc string, adding reference to 'help-window-setup'. (Bug#30792)
-rw-r--r--doc/lispref/help.texi19
-rw-r--r--lisp/help.el19
2 files changed, 19 insertions, 19 deletions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 33cc2f0d55b..6dd55d0b256 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -744,16 +744,17 @@ This function returns the name of the help buffer, which is normally
744@end defun 744@end defun
745 745
746@vindex help-window-select 746@vindex help-window-select
747@defmac with-help-window buffer-name body@dots{} 747@defmac with-help-window buffer-or-name body@dots{}
748This macro evaluates @var{body} like @code{with-output-to-temp-buffer} 748This macro evaluates @var{body} like @code{with-output-to-temp-buffer}
749(@pxref{Temporary Displays}), inserting any output produced by its forms 749(@pxref{Temporary Displays}), inserting any output produced by its
750into a buffer named @var{buffer-name}. (Usually, @var{buffer-name} 750forms into a buffer specified by @var{buffer-or-name}, which can be a
751should be the value returned by the function @code{help-buffer}.) It 751buffer or the name of a buffer. (Frequently, @var{buffer-or-name} is
752also puts the specified buffer into Help mode and displays a message 752the value returned by the function @code{help-buffer}.) This macro
753telling the user how to quit and scroll the help window. It selects the 753puts the specified buffer into Help mode and displays a message
754help window if the current value of the user option 754telling the user how to quit and scroll the help window. It selects
755@code{help-window-select} has been set accordingly. It returns the last 755the help window if the current value of the user option
756value in @var{body}. 756@code{help-window-select} has been set accordingly. It returns the
757last value in @var{body}.
757@end defmac 758@end defmac
758 759
759@defun help-setup-xref item interactive-p 760@defun help-setup-xref item interactive-p
diff --git a/lisp/help.el b/lisp/help.el
index 014af5141e3..958b06c0958 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1370,15 +1370,14 @@ Return VALUE."
1370 1370
1371;; (4) A marker (`help-window-point-marker') to move point in the help 1371;; (4) A marker (`help-window-point-marker') to move point in the help
1372;; window to an arbitrary buffer position. 1372;; window to an arbitrary buffer position.
1373(defmacro with-help-window (buffer-name &rest body) 1373(defmacro with-help-window (buffer-or-name &rest body)
1374 "Display buffer named BUFFER-NAME in a help window. 1374 "Evaluate BODY, send output to BUFFER-OR-NAME and show in a help window.
1375Evaluate the forms in BODY with standard output bound to a buffer 1375This construct is like `with-temp-buffer-window' but unlike that
1376called BUFFER-NAME (creating it if it does not exist), put that 1376puts the buffer specified by BUFFER-OR-NAME in `help-mode' and
1377buffer in `help-mode', display the buffer in a window (see 1377displays a message about how to delete the help window when it's no
1378`with-temp-buffer-window' for details) and issue a message how to 1378longer needed. The help window will be selected if
1379deal with that \"help\" window when it's no more needed. Select 1379`help-window-select' is non-nil. See `help-window-setup' for
1380the help window if the current value of the user option 1380more options."
1381`help-window-select' says so. Return last value in BODY."
1382 (declare (indent 1) (debug t)) 1381 (declare (indent 1) (debug t))
1383 `(progn 1382 `(progn
1384 ;; Make `help-window-point-marker' point nowhere. The only place 1383 ;; Make `help-window-point-marker' point nowhere. The only place
@@ -1390,7 +1389,7 @@ the help window if the current value of the user option
1390 (cons 'help-mode-finish temp-buffer-window-show-hook))) 1389 (cons 'help-mode-finish temp-buffer-window-show-hook)))
1391 (setq help-window-old-frame (selected-frame)) 1390 (setq help-window-old-frame (selected-frame))
1392 (with-temp-buffer-window 1391 (with-temp-buffer-window
1393 ,buffer-name nil 'help-window-setup (progn ,@body))))) 1392 ,buffer-or-name nil 'help-window-setup (progn ,@body)))))
1394 1393
1395;; Called from C, on encountering `help-char' when reading a char. 1394;; Called from C, on encountering `help-char' when reading a char.
1396;; Don't print to *Help*; that would clobber Help history. 1395;; Don't print to *Help*; that would clobber Help history.