mirror of
https://github.com/masscollaborationlabs/emacs.git
synced 2025-07-09 05:30:50 +00:00
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)
This commit is contained in:
parent
ec08c62f03
commit
2fb52abd9e
2 changed files with 19 additions and 19 deletions
|
@ -744,16 +744,17 @@ This function returns the name of the help buffer, which is normally
|
||||||
@end defun
|
@end defun
|
||||||
|
|
||||||
@vindex help-window-select
|
@vindex help-window-select
|
||||||
@defmac with-help-window buffer-name body@dots{}
|
@defmac with-help-window buffer-or-name body@dots{}
|
||||||
This macro evaluates @var{body} like @code{with-output-to-temp-buffer}
|
This macro evaluates @var{body} like @code{with-output-to-temp-buffer}
|
||||||
(@pxref{Temporary Displays}), inserting any output produced by its forms
|
(@pxref{Temporary Displays}), inserting any output produced by its
|
||||||
into a buffer named @var{buffer-name}. (Usually, @var{buffer-name}
|
forms into a buffer specified by @var{buffer-or-name}, which can be a
|
||||||
should be the value returned by the function @code{help-buffer}.) It
|
buffer or the name of a buffer. (Frequently, @var{buffer-or-name} is
|
||||||
also puts the specified buffer into Help mode and displays a message
|
the value returned by the function @code{help-buffer}.) This macro
|
||||||
telling the user how to quit and scroll the help window. It selects the
|
puts the specified buffer into Help mode and displays a message
|
||||||
help window if the current value of the user option
|
telling the user how to quit and scroll the help window. It selects
|
||||||
@code{help-window-select} has been set accordingly. It returns the last
|
the help window if the current value of the user option
|
||||||
value in @var{body}.
|
@code{help-window-select} has been set accordingly. It returns the
|
||||||
|
last value in @var{body}.
|
||||||
@end defmac
|
@end defmac
|
||||||
|
|
||||||
@defun help-setup-xref item interactive-p
|
@defun help-setup-xref item interactive-p
|
||||||
|
|
19
lisp/help.el
19
lisp/help.el
|
@ -1370,15 +1370,14 @@ Return VALUE."
|
||||||
|
|
||||||
;; (4) A marker (`help-window-point-marker') to move point in the help
|
;; (4) A marker (`help-window-point-marker') to move point in the help
|
||||||
;; window to an arbitrary buffer position.
|
;; window to an arbitrary buffer position.
|
||||||
(defmacro with-help-window (buffer-name &rest body)
|
(defmacro with-help-window (buffer-or-name &rest body)
|
||||||
"Display buffer named BUFFER-NAME in a help window.
|
"Evaluate BODY, send output to BUFFER-OR-NAME and show in a help window.
|
||||||
Evaluate the forms in BODY with standard output bound to a buffer
|
This construct is like `with-temp-buffer-window' but unlike that
|
||||||
called BUFFER-NAME (creating it if it does not exist), put that
|
puts the buffer specified by BUFFER-OR-NAME in `help-mode' and
|
||||||
buffer in `help-mode', display the buffer in a window (see
|
displays a message about how to delete the help window when it's no
|
||||||
`with-temp-buffer-window' for details) and issue a message how to
|
longer needed. The help window will be selected if
|
||||||
deal with that \"help\" window when it's no more needed. Select
|
`help-window-select' is non-nil. See `help-window-setup' for
|
||||||
the help window if the current value of the user option
|
more options."
|
||||||
`help-window-select' says so. Return last value in BODY."
|
|
||||||
(declare (indent 1) (debug t))
|
(declare (indent 1) (debug t))
|
||||||
`(progn
|
`(progn
|
||||||
;; Make `help-window-point-marker' point nowhere. The only place
|
;; 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
|
||||||
(cons 'help-mode-finish temp-buffer-window-show-hook)))
|
(cons 'help-mode-finish temp-buffer-window-show-hook)))
|
||||||
(setq help-window-old-frame (selected-frame))
|
(setq help-window-old-frame (selected-frame))
|
||||||
(with-temp-buffer-window
|
(with-temp-buffer-window
|
||||||
,buffer-name nil 'help-window-setup (progn ,@body)))))
|
,buffer-or-name nil 'help-window-setup (progn ,@body)))))
|
||||||
|
|
||||||
;; Called from C, on encountering `help-char' when reading a char.
|
;; Called from C, on encountering `help-char' when reading a char.
|
||||||
;; Don't print to *Help*; that would clobber Help history.
|
;; Don't print to *Help*; that would clobber Help history.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue