From e6f3e10423a495db8bd3a33e50f581d46b026452 Mon Sep 17 00:00:00 2001 From: Martin Rudalics Date: Sat, 4 Oct 2008 10:09:46 +0000 Subject: [PATCH] (compilation-start): Make sure to move to point-max only when we are in the compilation buffer. --- lisp/ChangeLog | 5 +++++ lisp/progmodes/compile.el | 14 +++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b13f1b48c4c..f110de99cb8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-10-04 Martin Rudalics + + * progmodes/compile.el (compilation-start): Make sure to move to + point-max only when we are in the compilation buffer. (Bug#1073) + 2008-10-04 Dan Nicolaescu * faces.el (x-create-frame-with-faces): Only setup the toolbar if diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 65e8f952b64..79049a49cfb 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -1279,11 +1279,15 @@ Returns the compilation buffer created." (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))) -- 2.39.5