aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2012-11-10 17:47:56 -0800
committerGlenn Morris2012-11-10 17:47:56 -0800
commit38785e75a29b546512ec58fd96b1946b4b98417c (patch)
treee9d04001f05552c7a029967a0f2288f351c4bb60
parent57fc0fee5fd12dd5b43323d127fea62040c01c79 (diff)
downloademacs-38785e75a29b546512ec58fd96b1946b4b98417c.tar.gz
emacs-38785e75a29b546512ec58fd96b1946b4b98417c.zip
* lisp/window.el (with-temp-buffer-window): Doc tweak.
-rw-r--r--lisp/ChangeLog2
-rw-r--r--lisp/window.el35
2 files changed, 19 insertions, 18 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index d7f86f510c5..d89b0b19359 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,7 @@
12012-11-11 Glenn Morris <rgm@gnu.org> 12012-11-11 Glenn Morris <rgm@gnu.org>
2 2
3 * window.el (with-temp-buffer-window): Doc tweak.
4
3 * emacs-lisp/debug.el (debugger-bury-or-kill): Doc tweak. 5 * emacs-lisp/debug.el (debugger-bury-or-kill): Doc tweak.
4 6
5 * help.el (temp-buffer-max-height): 7 * help.el (temp-buffer-max-height):
diff --git a/lisp/window.el b/lisp/window.el
index b3a66ca1dd3..30ee622cfe6 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -143,37 +143,36 @@ to `display-buffer'."
143 window)))) 143 window))))
144 144
145(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body) 145(defmacro with-temp-buffer-window (buffer-or-name action quit-function &rest body)
146 "Evaluate BODY and display buffer specified by BUFFER-OR-NAME. 146 "Evaluate BODY and display the buffer specified by BUFFER-OR-NAME.
147BUFFER-OR-NAME must specify either a live buffer or the name of a 147BUFFER-OR-NAME must specify either a live buffer, or the name of a
148buffer. If no buffer with such a name exists, create one. 148buffer (if it does not exist, this macro creates it).
149 149
150Make sure the specified buffer is empty before evaluating BODY. 150Make sure the specified buffer is empty before evaluating BODY.
151Do not make that buffer current for BODY. Instead, bind 151Do not make that buffer current for BODY. Instead, bind
152`standard-output' to that buffer, so that output generated with 152`standard-output' to that buffer, so that output generated with
153`prin1' and similar functions in BODY goes into that buffer. 153`prin1' and similar functions in BODY goes into that buffer.
154 154
155After evaluating BODY, mark the specified buffer unmodified and 155After evaluating BODY, this marks the specified buffer unmodified and
156read-only, and display it in a window via `display-buffer'. Pass 156read-only, and displays it in a window via `display-buffer', passing
157ACTION as action argument to `display-buffer'. Automatically 157ACTION as the action argument to `display-buffer'. It automatically
158shrink the window used if `temp-buffer-resize-mode' is enabled. 158shrinks the relevant window if `temp-buffer-resize-mode' is enabled.
159 159
160Return the value returned by BODY unless QUIT-FUNCTION specifies 160Returns the value returned by BODY, unless QUIT-FUNCTION specifies
161a function. In that case, run the function with two arguments - 161a function. In that case, runs the function with two arguments -
162the window showing the specified buffer and the value returned by 162the window showing the specified buffer and the value returned by
163BODY - and return the value returned by that function. 163BODY - and returns the value returned by that function.
164 164
165If the buffer is displayed on a new frame, the window manager may 165If the buffer is displayed on a new frame, the window manager may
166decide to select that frame. In that case, it's usually a good 166decide to select that frame. In that case, it's usually a good
167strategy if the function specified by QUIT-FUNCTION selects the 167strategy if the function specified by QUIT-FUNCTION selects the
168window showing the buffer before reading a value from the 168window showing the buffer before reading a value from the
169minibuffer, for example, when asking a `yes-or-no-p' question. 169minibuffer; for example, when asking a `yes-or-no-p' question.
170 170
171This construct is similar to `with-output-to-temp-buffer' but 171This construct is similar to `with-output-to-temp-buffer', but does
172does neither put the buffer in help mode nor does it call 172not put the buffer in help mode, or call `temp-buffer-show-function'.
173`temp-buffer-show-function'. It also runs different hooks, 173It also runs different hooks, namely `temp-buffer-window-setup-hook'
174namely `temp-buffer-window-setup-hook' (with the specified buffer 174\(with the specified buffer current) and `temp-buffer-window-show-hook'
175current) and `temp-buffer-window-show-hook' (with the specified 175\(with the specified buffer current and the window showing it selected).
176buffer current and the window showing it selected).
177 176
178Since this macro calls `display-buffer', the window displaying 177Since this macro calls `display-buffer', the window displaying
179the buffer is usually not selected and the specified buffer 178the buffer is usually not selected and the specified buffer