Mercurial > emacs
changeset 8522:593457877265
(compilation-set-window-height): Add save-excursion.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Thu, 11 Aug 1994 21:45:47 +0000 |
parents | 340ebdb14a0e |
children | b8d0aeb2de42 |
files | lisp/progmodes/compile.el |
diffstat | 1 files changed, 10 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/compile.el Thu Aug 11 21:38:02 1994 +0000 +++ b/lisp/progmodes/compile.el Thu Aug 11 21:45:47 1994 +0000 @@ -406,13 +406,16 @@ ;; If window is alone in its frame, aside from a minibuffer, ;; don't change its height. (not (eq window (frame-root-window (window-frame window)))) - (let ((w (selected-window))) - (unwind-protect - (progn - (select-window window) - (enlarge-window (- compilation-window-height - (window-height)))) - (select-window w))))) + ;; This save-excursion prevents us from changing the current buffer, + ;; which might not be the same as the selected window's buffer. + (save-excursion + (let ((w (selected-window))) + (unwind-protect + (progn + (select-window window) + (enlarge-window (- compilation-window-height + (window-height)))) + (select-window w)))))) (defvar compilation-minor-mode-map (let ((map (make-sparse-keymap)))