aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/ChangeLog16
-rw-r--r--lisp/help.el11
-rw-r--r--lisp/window.el57
3 files changed, 49 insertions, 35 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 6c645e750d2..68f7ebd6fb0 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,7 +1,16 @@
12014-02-28 Martin Rudalics <rudalics@gmx.at>
2
3 Revert recent with-temp-buffer-window change (Bug#16816, Bug#16882).
4 * window.el (with-temp-buffer-window): Revert change from
5 2014-02-21. Suggested by Thierry Volpiatto
6 <thierry.volpiatto@gmail.com>. Fix doc-string based on a
7 suggestion by Nicolas Richard <theonewiththeevillook@yahoo.fr>.
8 * help.el (with-help-window): Fix doc-string.
9
12014-02-28 Ivan Kanis <ivan@kanis.fr> 102014-02-28 Ivan Kanis <ivan@kanis.fr>
2 11
3 * net/shr.el (shr-put-image): add custom variable 12 * net/shr.el (shr-put-image): Add custom variable
4 `shr-image-animate' to turn off image animation. It is so slow it 13 `shr-image-animate' to turn off image animation. It is so slow it
5 will render emacs unusable. 14 will render emacs unusable.
6 15
72014-02-28 Michael Albinus <michael.albinus@gmx.de> 162014-02-28 Michael Albinus <michael.albinus@gmx.de>
@@ -3304,7 +3313,8 @@
3304 * emacs-lisp/debug.el (debug): Use window-total-height instead 3313 * emacs-lisp/debug.el (debug): Use window-total-height instead
3305 of window-total-size. 3314 of window-total-size.
3306 * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height. 3315 * frame.el (tool-bar-lines-needed): Defalias to tool-bar-height.
3307 * help.el (describe-bindings-internal): Call help-buffer 3316 * help.el (describe-bindings-internal): Use help-buffer as
3317 argument for with-help-window.
3308 (temp-buffer-max-width): New option. 3318 (temp-buffer-max-width): New option.
3309 (resize-temp-buffer-window, help-window-setup) 3319 (resize-temp-buffer-window, help-window-setup)
3310 (with-help-window): Rewrite. 3320 (with-help-window): Rewrite.
diff --git a/lisp/help.el b/lisp/help.el
index f00accc370c..1e3d41eb88a 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -1194,9 +1194,14 @@ Return VALUE."
1194;; Note: It's usually always wrong to use `help-print-return-message' in 1194;; Note: It's usually always wrong to use `help-print-return-message' in
1195;; the body of `with-help-window'. 1195;; the body of `with-help-window'.
1196(defmacro with-help-window (buffer-name &rest body) 1196(defmacro with-help-window (buffer-name &rest body)
1197 "Display buffer with name BUFFER-NAME in a help window evaluating BODY. 1197 "Display buffer with name BUFFER-NAME in a help window.
1198Select help window if the current value of the user option 1198Evaluate the forms in BODY with the buffer specified by
1199`help-window-select' says so. Return last value in BODY." 1199BUFFER-NAME current, put that buffer in `help-mode', display the
1200buffer in a window (see `with-temp-buffer-window' for details)
1201and issue a message how to deal with that \"help\" window when
1202it's no more needed. Select the help window if the current value
1203of the user option `help-window-select' says so. Return last
1204value in BODY."
1200 (declare (indent 1) (debug t)) 1205 (declare (indent 1) (debug t))
1201 `(progn 1206 `(progn
1202 ;; Make `help-window-point-marker' point nowhere. The only place 1207 ;; Make `help-window-point-marker' point nowhere. The only place
diff --git a/lisp/window.el b/lisp/window.el
index 72b3138fd73..e51c54012af 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -142,28 +142,27 @@ to `display-buffer'."
142 ;; Return the window. 142 ;; Return the window.
143 window)))) 143 window))))
144 144
145;; Doc is very similar to with-output-to-temp-buffer.
146(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)
147 "Bind `standard-output' to BUFFER-OR-NAME, eval BODY, show the buffer. 146 "Evaluate BODY in a buffer BUFFER-OR-NAME and show that buffer.
148BUFFER-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
149buffer (if it does not exist, this macro creates it). 148a buffer (if it does not exist, this macro creates it).
150 149
151This construct makes buffer BUFFER-OR-NAME empty before running BODY. 150Make the buffer specified by BUFFER-OR-NAME empty before running
152It does not make the buffer current for BODY. 151BODY and make that buffer current for running the forms in BODY.
153Instead it binds `standard-output' to that buffer, so that output 152In addition, bind `standard-output' to that buffer, so that
154generated with `prin1' and similar functions in BODY goes into 153output generated with `prin1' and similar functions in BODY goes
155the buffer. 154into that buffer.
156 155
157At the end of BODY, this marks the specified buffer unmodified and 156At the end of BODY, mark the specified buffer unmodified and
158read-only, and displays it in a window (but does not select it, or make 157read-only, and display it in a window (but do not select it).
159the buffer current). The display happens by calling `display-buffer' 158The display happens by calling `display-buffer' passing it the
160with the ACTION argument. If `temp-buffer-resize-mode' is enabled, 159ACTION argument. If `temp-buffer-resize-mode' is enabled, the
161the relevant window shrinks automatically. 160corresponding window may shrink automatically.
162 161
163This returns the value returned by BODY, unless QUIT-FUNCTION specifies 162Return the value returned by BODY, unless QUIT-FUNCTION specifies
164a function. In that case, it runs the function with two arguments - 163a function. In that case, run that function with two arguments -
165the window showing the specified buffer and the value returned by 164the window showing the specified buffer and the value returned by
166BODY - and returns the value returned by that function. 165BODY - and return the value returned by that function.
167 166
168If the buffer is displayed on a new frame, the window manager may 167If the buffer is displayed on a new frame, the window manager may
169decide to select that frame. In that case, it's usually a good 168decide to select that frame. In that case, it's usually a good
@@ -172,16 +171,16 @@ before reading any value from the minibuffer; for example, when
172asking a `yes-or-no-p' question. 171asking a `yes-or-no-p' question.
173 172
174This runs the hook `temp-buffer-window-setup-hook' before BODY, 173This runs the hook `temp-buffer-window-setup-hook' before BODY,
175with the specified buffer temporarily current. It runs the 174with the specified buffer temporarily current. It runs the hook
176hook `temp-buffer-window-show-hook' after displaying the buffer, 175`temp-buffer-window-show-hook' after displaying the buffer, with
177with that buffer temporarily current, and the window that was used to 176that buffer temporarily current, and the window that was used to
178display it temporarily selected. 177display it temporarily selected.
179 178
180This construct is similar to `with-output-to-temp-buffer', but 179This construct is similar to `with-output-to-temp-buffer' but,
181runs different hooks. In particular, it does not run 180unlike that, makes BUFFER-OR-NAME current when running BODY.
182`temp-buffer-setup-hook', which usually puts the buffer in Help mode. 181Also, it neither runs `temp-buffer-setup-hook' which usually puts
183Also, it does not call `temp-buffer-show-function' (the ACTION 182the buffer in Help mode, nor `temp-buffer-show-function' (the
184argument replaces this)." 183ACTION argument replaces this)."
185 (declare (debug t)) 184 (declare (debug t))
186 (let ((buffer (make-symbol "buffer")) 185 (let ((buffer (make-symbol "buffer"))
187 (window (make-symbol "window")) 186 (window (make-symbol "window"))
@@ -189,8 +188,8 @@ argument replaces this)."
189 `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name)) 188 `(let* ((,buffer (temp-buffer-window-setup ,buffer-or-name))
190 (standard-output ,buffer) 189 (standard-output ,buffer)
191 ,window ,value) 190 ,window ,value)
192 (setq ,value (progn ,@body))
193 (with-current-buffer ,buffer 191 (with-current-buffer ,buffer
192 (setq ,value (progn ,@body))
194 (setq ,window (temp-buffer-window-show ,buffer ,action))) 193 (setq ,window (temp-buffer-window-show ,buffer ,action)))
195 194
196 (if (functionp ,quit-function) 195 (if (functionp ,quit-function)