Fix behavior of with-temp-buffer-window (Bug#16816, Bug#17007).
[bpt/emacs.git] / doc / lispref / help.texi
index 50103d3..9a763b6 100644 (file)
@@ -649,14 +649,17 @@ This function returns the name of the help buffer, which is normally
 @file{*Help*}; if such a buffer does not exist, it is first created.
 @end defun
 
+@vindex help-window-select
 @defmac with-help-window buffer-name body@dots{}
-This macro evaluates the @var{body} forms, inserting any output they
-produce into a buffer named @var{buffer-name} like
-@code{with-output-to-temp-buffer} (@pxref{Temporary Displays}).
-(Usually, @var{buffer-name} should be the value returned by the
-function @code{help-buffer}.)  It also puts the specified buffer into
-Help mode and displays a message telling the user how to quit and
-scroll the help window.
+This macro evaluates @var{body} like @code{with-output-to-temp-buffer}
+(@pxref{Temporary Displays}), inserting any output produced by its forms
+into a buffer named @var{buffer-name}.  (Usually, @var{buffer-name}
+should be the value returned by the function @code{help-buffer}.)  It
+also puts the specified buffer into Help mode and displays a message
+telling the user how to quit and scroll the help window.  It selects the
+help window if the current value of the user option
+@code{help-window-select} has been set accordingly.  It returns the last
+value in @var{body}.
 @end defmac
 
 @defun help-setup-xref item interactive-p