diff options
| -rw-r--r-- | lisp/ChangeLog | 16 | ||||
| -rw-r--r-- | lisp/help.el | 11 | ||||
| -rw-r--r-- | lisp/window.el | 57 |
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 @@ | |||
| 1 | 2014-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 | |||
| 1 | 2014-02-28 Ivan Kanis <ivan@kanis.fr> | 10 | 2014-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 | ||
| 7 | 2014-02-28 Michael Albinus <michael.albinus@gmx.de> | 16 | 2014-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. |
| 1198 | Select help window if the current value of the user option | 1198 | Evaluate the forms in BODY with the buffer specified by |
| 1199 | `help-window-select' says so. Return last value in BODY." | 1199 | BUFFER-NAME current, put that buffer in `help-mode', display the |
| 1200 | buffer in a window (see `with-temp-buffer-window' for details) | ||
| 1201 | and issue a message how to deal with that \"help\" window when | ||
| 1202 | it's no more needed. Select the help window if the current value | ||
| 1203 | of the user option `help-window-select' says so. Return last | ||
| 1204 | value 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. |
| 148 | BUFFER-OR-NAME must specify either a live buffer, or the name of a | 147 | BUFFER-OR-NAME must specify either a live buffer, or the name of |
| 149 | buffer (if it does not exist, this macro creates it). | 148 | a buffer (if it does not exist, this macro creates it). |
| 150 | 149 | ||
| 151 | This construct makes buffer BUFFER-OR-NAME empty before running BODY. | 150 | Make the buffer specified by BUFFER-OR-NAME empty before running |
| 152 | It does not make the buffer current for BODY. | 151 | BODY and make that buffer current for running the forms in BODY. |
| 153 | Instead it binds `standard-output' to that buffer, so that output | 152 | In addition, bind `standard-output' to that buffer, so that |
| 154 | generated with `prin1' and similar functions in BODY goes into | 153 | output generated with `prin1' and similar functions in BODY goes |
| 155 | the buffer. | 154 | into that buffer. |
| 156 | 155 | ||
| 157 | At the end of BODY, this marks the specified buffer unmodified and | 156 | At the end of BODY, mark the specified buffer unmodified and |
| 158 | read-only, and displays it in a window (but does not select it, or make | 157 | read-only, and display it in a window (but do not select it). |
| 159 | the buffer current). The display happens by calling `display-buffer' | 158 | The display happens by calling `display-buffer' passing it the |
| 160 | with the ACTION argument. If `temp-buffer-resize-mode' is enabled, | 159 | ACTION argument. If `temp-buffer-resize-mode' is enabled, the |
| 161 | the relevant window shrinks automatically. | 160 | corresponding window may shrink automatically. |
| 162 | 161 | ||
| 163 | This returns the value returned by BODY, unless QUIT-FUNCTION specifies | 162 | Return the value returned by BODY, unless QUIT-FUNCTION specifies |
| 164 | a function. In that case, it runs the function with two arguments - | 163 | a function. In that case, run that function with two arguments - |
| 165 | the window showing the specified buffer and the value returned by | 164 | the window showing the specified buffer and the value returned by |
| 166 | BODY - and returns the value returned by that function. | 165 | BODY - and return the value returned by that function. |
| 167 | 166 | ||
| 168 | If the buffer is displayed on a new frame, the window manager may | 167 | If the buffer is displayed on a new frame, the window manager may |
| 169 | decide to select that frame. In that case, it's usually a good | 168 | decide 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 | |||
| 172 | asking a `yes-or-no-p' question. | 171 | asking a `yes-or-no-p' question. |
| 173 | 172 | ||
| 174 | This runs the hook `temp-buffer-window-setup-hook' before BODY, | 173 | This runs the hook `temp-buffer-window-setup-hook' before BODY, |
| 175 | with the specified buffer temporarily current. It runs the | 174 | with the specified buffer temporarily current. It runs the hook |
| 176 | hook `temp-buffer-window-show-hook' after displaying the buffer, | 175 | `temp-buffer-window-show-hook' after displaying the buffer, with |
| 177 | with that buffer temporarily current, and the window that was used to | 176 | that buffer temporarily current, and the window that was used to |
| 178 | display it temporarily selected. | 177 | display it temporarily selected. |
| 179 | 178 | ||
| 180 | This construct is similar to `with-output-to-temp-buffer', but | 179 | This construct is similar to `with-output-to-temp-buffer' but, |
| 181 | runs different hooks. In particular, it does not run | 180 | unlike that, makes BUFFER-OR-NAME current when running BODY. |
| 182 | `temp-buffer-setup-hook', which usually puts the buffer in Help mode. | 181 | Also, it neither runs `temp-buffer-setup-hook' which usually puts |
| 183 | Also, it does not call `temp-buffer-show-function' (the ACTION | 182 | the buffer in Help mode, nor `temp-buffer-show-function' (the |
| 184 | argument replaces this)." | 183 | ACTION 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) |