]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/compile.el
Merge from emacs-24; up to 117634
[gnu-emacs] / lisp / progmodes / compile.el
index ee066f4c56cf2ac219b49bd04d371a06b3e232b1..d3d03cd203035bef847404e5fe0043487be76f59 100644 (file)
@@ -1676,7 +1676,16 @@ Returns the compilation buffer created."
             (list command mode name-function highlight-regexp))
        (set (make-local-variable 'revert-buffer-function)
             'compilation-revert-buffer)
-       (and outwin (set-window-start outwin (point-min)))
+       (and outwin
+            ;; Forcing the window-start overrides the usual redisplay
+            ;; feature of bringing point into view, so setting the
+            ;; window-start to top of the buffer risks losing the
+            ;; effect of moving point to EOB below, per
+            ;; compilation-scroll-output, if the command is long
+            ;; enough to push point outside of the window.  This
+            ;; could happen, e.g., in `rgrep'.
+            (not compilation-scroll-output)
+            (set-window-start outwin (point-min)))
 
        ;; Position point as the user will see it.
        (let ((desired-visible-point