diff options
| author | Stefan Monnier | 2003-05-13 21:37:28 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2003-05-13 21:37:28 +0000 |
| commit | 812fade8086abc02429a41db539eec4e41d16749 (patch) | |
| tree | 0ccf41540425f850f9ae47fd287c12a5f902b575 | |
| parent | 96a483d9542a5348c17a7057b275e9d8f4b40676 (diff) | |
| download | emacs-812fade8086abc02429a41db539eec4e41d16749.tar.gz emacs-812fade8086abc02429a41db539eec4e41d16749.zip | |
(compile-internal): Use with-current-buffer.
(compilation-set-window-height): Use save-selected-window.
| -rw-r--r-- | lisp/progmodes/compile.el | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 6cbc7ce5e45..f9ce01edd85 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el | |||
| @@ -1,6 +1,6 @@ | |||
| 1 | ;;; compile.el --- run compiler as inferior of Emacs, parse error messages | 1 | ;;; compile.el --- run compiler as inferior of Emacs, parse error messages |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001 | 3 | ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001, 2003 |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Author: Roland McGrath <roland@gnu.org> | 6 | ;; Author: Roland McGrath <roland@gnu.org> |
| @@ -1051,8 +1051,7 @@ Returns the compilation buffer created." | |||
| 1051 | (goto-char (point-max))) | 1051 | (goto-char (point-max))) |
| 1052 | ;; Pop up the compilation buffer. | 1052 | ;; Pop up the compilation buffer. |
| 1053 | (setq outwin (display-buffer outbuf nil t)) | 1053 | (setq outwin (display-buffer outbuf nil t)) |
| 1054 | (save-excursion | 1054 | (with-current-buffer outbuf |
| 1055 | (set-buffer outbuf) | ||
| 1056 | (compilation-mode name-of-mode) | 1055 | (compilation-mode name-of-mode) |
| 1057 | ;; In what way is it non-ergonomic ? -stef | 1056 | ;; In what way is it non-ergonomic ? -stef |
| 1058 | ;; (toggle-read-only 1) ;;; Non-ergonomic. | 1057 | ;; (toggle-read-only 1) ;;; Non-ergonomic. |
| @@ -1144,19 +1143,13 @@ exited abnormally with code %d\n" | |||
| 1144 | ;; If window is alone in its frame, aside from a minibuffer, | 1143 | ;; If window is alone in its frame, aside from a minibuffer, |
| 1145 | ;; don't change its height. | 1144 | ;; don't change its height. |
| 1146 | (not (eq window (frame-root-window (window-frame window)))) | 1145 | (not (eq window (frame-root-window (window-frame window)))) |
| 1147 | ;; This save-excursion prevents us from changing the current buffer, | 1146 | ;; This save-current-buffer prevents us from changing the current |
| 1148 | ;; which might not be the same as the selected window's buffer. | 1147 | ;; buffer, which might not be the same as the selected window's buffer. |
| 1149 | (save-excursion | 1148 | (save-current-buffer |
| 1150 | (let ((w (selected-window))) | 1149 | (save-selected-window |
| 1151 | (unwind-protect | 1150 | (select-window window) |
| 1152 | (progn | 1151 | (enlarge-window (- compilation-window-height |
| 1153 | (select-window window) | 1152 | (window-height))))))) |
| 1154 | (enlarge-window (- compilation-window-height | ||
| 1155 | (window-height)))) | ||
| 1156 | ;; The enlarge-window above may have deleted W, if | ||
| 1157 | ;; compilation-window-height is large enough. | ||
| 1158 | (when (window-live-p w) | ||
| 1159 | (select-window w))))))) | ||
| 1160 | 1153 | ||
| 1161 | (defvar compilation-menu-map | 1154 | (defvar compilation-menu-map |
| 1162 | (let ((map (make-sparse-keymap "Errors"))) | 1155 | (let ((map (make-sparse-keymap "Errors"))) |