# HG changeset patch # User Martin Rudalics # Date 1223114699 0 # Node ID 6e7acef982ee494b0b5eb78f2cb81c89ab5b2c8a # Parent 43f948ece77010893c01cf791486cbeaca95d2fc (compilation-start): Make sure to move to point-max only when we are in the compilation buffer. diff -r 43f948ece770 -r 6e7acef982ee lisp/progmodes/compile.el --- 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)))