]> git.eshelyaron.com Git - emacs.git/commitdiff
(compilation-set-window-height): Add save-excursion.
authorRichard M. Stallman <rms@gnu.org>
Thu, 11 Aug 1994 21:45:47 +0000 (21:45 +0000)
committerRichard M. Stallman <rms@gnu.org>
Thu, 11 Aug 1994 21:45:47 +0000 (21:45 +0000)
lisp/progmodes/compile.el

index 7ecc68aa5bebca19bd78293016e06c7390fa4c54..3c465702ac86191d33631e1c23311929bd1ef4b4 100644 (file)
@@ -406,13 +406,16 @@ Returns the compilation buffer created."
        ;; 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)))