changeset 98499:6e7acef982ee

(compilation-start): Make sure to move to point-max only when we are in the compilation buffer.
author Martin Rudalics <rudalics@gmx.at>
date Sat, 04 Oct 2008 10:04:59 +0000
parents 43f948ece770
children 5b9bdbae18f6
files lisp/progmodes/compile.el
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/compile.el	Sat Oct 04 09:22:56 2008 +0000
+++ b/lisp/progmodes/compile.el	Sat Oct 04 10:04:59 2008 +0000
@@ -1279,11 +1279,15 @@
 	  (setq compilation-in-progress
 		(cons proc compilation-in-progress))))
       ;; Now finally cd to where the shell started make/grep/...
-      (setq default-directory thisdir))
-    (if (buffer-local-value 'compilation-scroll-output outbuf)
-	(save-selected-window
-	  (select-window outwin)
-	  (goto-char (point-max))))
+      (setq default-directory thisdir)
+      ;; The following form selected outwin ever since revision 1.183,
+      ;; so possibly messing up point in some other window (bug#1073).
+      ;; Moved into the scope of with-current-buffer, though still with
+      ;; complete disregard for the case when compilation-scroll-output
+      ;; equals 'first-error (martin 2008-10-04).
+      (when compilation-scroll-output
+	(goto-char (point-max))))
+
     ;; Make it so the next C-x ` will use this buffer.
     (setq next-error-last-buffer outbuf)))