]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #18874 with rgrep not obeying grep-scroll-output.
authorEli Zaretskii <eliz@gnu.org>
Wed, 29 Oct 2014 15:17:18 +0000 (17:17 +0200)
committerEli Zaretskii <eliz@gnu.org>
Wed, 29 Oct 2014 15:17:18 +0000 (17:17 +0200)
 lisp/progmodes/compile.el (compilation-start): If
 compilation-scroll-output is non-nil, don't force window-start of
 the compilation buffer to be at beginning of buffer.

lisp/ChangeLog
lisp/progmodes/compile.el

index 67efd55852860836065b9d905d5e8222800e9d0a..b3b8ba4c1a97f10cb5b8cc1facc39849285ae777 100644 (file)
@@ -1,3 +1,9 @@
+2014-10-29  Eli Zaretskii  <eliz@gnu.org>
+
+       * progmodes/compile.el (compilation-start): If
+       compilation-scroll-output is non-nil, don't force window-start of
+       the compilation buffer to be at beginning of buffer.  (Bug#18874)
+
 2014-10-23  Tassilo Horn  <tsdh@gnu.org>
 
        * doc-view.el (doc-view-open-text): View the document's plain text
index 30f30dfe83fa1787ac3552c08e50e0207d54d581..d2f7d595cbce686d80481e1ed152d817dbf68ca8 100644 (file)
@@ -1651,7 +1651,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