diff options
| author | Glenn Morris | 2012-11-12 18:25:59 -0800 |
|---|---|---|
| committer | Glenn Morris | 2012-11-12 18:25:59 -0800 |
| commit | f78ee6afc094cdfd6162bfd645836e84875dcddf (patch) | |
| tree | 3a2c4f5d6441e53adadb69ed2af0b64abf3cf239 /lisp/window.el | |
| parent | b95a9c0cba301ef8f1920a1d123ccd6873c14a63 (diff) | |
| parent | f8705f6e3102454bf1e3213956eb3ac8160ff047 (diff) | |
| download | emacs-f78ee6afc094cdfd6162bfd645836e84875dcddf.tar.gz emacs-f78ee6afc094cdfd6162bfd645836e84875dcddf.zip | |
Merge from emacs-24; up to 2012-11-09T14:45:15Z!dmantipov@yandex.ru
Diffstat (limited to 'lisp/window.el')
| -rw-r--r-- | lisp/window.el | 37 |
1 files changed, 18 insertions, 19 deletions
diff --git a/lisp/window.el b/lisp/window.el index be6ddf8ab9e..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. |
| 147 | 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 a |
| 148 | buffer. If no buffer with such a name exists, create one. | 148 | buffer (if it does not exist, this macro creates it). |
| 149 | 149 | ||
| 150 | Make sure the specified buffer is empty before evaluating BODY. | 150 | Make sure the specified buffer is empty before evaluating BODY. |
| 151 | Do not make that buffer current for BODY. Instead, bind | 151 | Do 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 | ||
| 155 | After evaluating BODY, mark the specified buffer unmodified and | 155 | After evaluating BODY, this marks the specified buffer unmodified and |
| 156 | read-only, and display it in a window via `display-buffer'. Pass | 156 | read-only, and displays it in a window via `display-buffer', passing |
| 157 | ACTION as action argument to `display-buffer'. Automatically | 157 | ACTION as the action argument to `display-buffer'. It automatically |
| 158 | shrink the window used if `temp-buffer-resize-mode' is enabled. | 158 | shrinks the relevant window if `temp-buffer-resize-mode' is enabled. |
| 159 | 159 | ||
| 160 | Return the value returned by BODY unless QUIT-FUNCTION specifies | 160 | Returns the value returned by BODY, unless QUIT-FUNCTION specifies |
| 161 | a function. In that case, run the function with two arguments - | 161 | a function. In that case, runs the function with two arguments - |
| 162 | the window showing the specified buffer and the value returned by | 162 | the window showing the specified buffer and the value returned by |
| 163 | BODY - and return the value returned by that function. | 163 | BODY - and returns the value returned by that function. |
| 164 | 164 | ||
| 165 | If the buffer is displayed on a new frame, the window manager may | 165 | If the buffer is displayed on a new frame, the window manager may |
| 166 | decide to select that frame. In that case, it's usually a good | 166 | decide to select that frame. In that case, it's usually a good |
| 167 | strategy if the function specified by QUIT-FUNCTION selects the | 167 | strategy if the function specified by QUIT-FUNCTION selects the |
| 168 | window showing the buffer before reading a value from the | 168 | window showing the buffer before reading a value from the |
| 169 | minibuffer, for example, when asking a `yes-or-no-p' question. | 169 | minibuffer; for example, when asking a `yes-or-no-p' question. |
| 170 | 170 | ||
| 171 | This construct is similar to `with-output-to-temp-buffer' but | 171 | This construct is similar to `with-output-to-temp-buffer', but does |
| 172 | does neither put the buffer in help mode nor does it call | 172 | not put the buffer in help mode, or call `temp-buffer-show-function'. |
| 173 | `temp-buffer-show-function'. It also runs different hooks, | 173 | It also runs different hooks, namely `temp-buffer-window-setup-hook' |
| 174 | namely `temp-buffer-window-setup-hook' (with the specified buffer | 174 | \(with the specified buffer current) and `temp-buffer-window-show-hook' |
| 175 | current) and `temp-buffer-window-show-hook' (with the specified | 175 | \(with the specified buffer current and the window showing it selected). |
| 176 | buffer current and the window showing it selected). | ||
| 177 | 176 | ||
| 178 | Since this macro calls `display-buffer', the window displaying | 177 | Since this macro calls `display-buffer', the window displaying |
| 179 | the buffer is usually not selected and the specified buffer | 178 | the buffer is usually not selected and the specified buffer |
| @@ -6065,7 +6064,7 @@ A frame can be resized if and only if its root window is a live | |||
| 6065 | window. The height of the root window is subject to the values | 6064 | window. The height of the root window is subject to the values |
| 6066 | of `fit-frame-to-buffer-max-height' and `window-min-height'." | 6065 | of `fit-frame-to-buffer-max-height' and `window-min-height'." |
| 6067 | :type 'boolean | 6066 | :type 'boolean |
| 6068 | :version "24.2" | 6067 | :version "24.3" |
| 6069 | :group 'help) | 6068 | :group 'help) |
| 6070 | 6069 | ||
| 6071 | (defcustom fit-frame-to-buffer-bottom-margin 4 | 6070 | (defcustom fit-frame-to-buffer-bottom-margin 4 |
| @@ -6073,7 +6072,7 @@ of `fit-frame-to-buffer-max-height' and `window-min-height'." | |||
| 6073 | This is the number of lines `fit-frame-to-buffer' leaves free at the | 6072 | This is the number of lines `fit-frame-to-buffer' leaves free at the |
| 6074 | bottom of the display in order to not obscure the system task bar." | 6073 | bottom of the display in order to not obscure the system task bar." |
| 6075 | :type 'integer | 6074 | :type 'integer |
| 6076 | :version "24.2" | 6075 | :version "24.3" |
| 6077 | :group 'windows) | 6076 | :group 'windows) |
| 6078 | 6077 | ||
| 6079 | (defun fit-frame-to-buffer (&optional frame max-height min-height) | 6078 | (defun fit-frame-to-buffer (&optional frame max-height min-height) |