aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorRichard M. Stallman <[email protected]>2009-05-18 16:30:59 +0000
committerRichard M. Stallman <[email protected]>2009-05-18 16:30:59 +0000
commit0b508a27360a82763d4d7256b4cd526f9d3514aa (patch)
tree4faea83b23d4a9e100bcf8f7ad17d19f33c30d06 /lisp
parent4df49ff1d29649952368f633c4f1f6016429b1e6 (diff)
* progmodes/compile.el (compilation-filter): If inserting at end
of accessible part of buffer, keep end of output visible.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog3
-rw-r--r--lisp/progmodes/compile.el13
2 files changed, 14 insertions, 2 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index b124112394..cfc11bd2e4 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-05-18 Richard M Stallman <[email protected]>
+ * progmodes/compile.el (compilation-filter): If inserting at end
+ of accessible part of buffer, keep end of output visible.
+
* mail/rmail.el (rmail-expunge-confirmed): Return nil if nothing to do.
Don't call rmail-modify-format here.
(rmail-expunge): Call it here after expunge is confirmed.
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 2b3b954a41..283a37acd8 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1739,9 +1739,15 @@ and runs `compilation-filter-hook'."
(with-current-buffer (process-buffer proc)
(let ((inhibit-read-only t)
;; `save-excursion' doesn't use the right insertion-type for us.
- (pos (copy-marker (point) t)))
+ (pos (copy-marker (point) t))
+ (min (point-min-marker))
+ (max (point-max-marker)))
(unwind-protect
(progn
+ ;; If we are inserting at the end of the accessible part
+ ;; of the buffer, keep the inserted text visible.
+ (set-marker-insertion-type max t)
+ (widen)
(goto-char (process-mark proc))
;; We used to use `insert-before-markers', so that windows with
;; point at `process-mark' scroll along with the output, but we
@@ -1751,7 +1757,10 @@ and runs `compilation-filter-hook'."
(comint-carriage-motion (process-mark proc) (point)))
(set-marker (process-mark proc) (point))
(run-hooks 'compilation-filter-hook))
- (goto-char pos))))))
+ (goto-char pos)
+ (narrow-to-region min max)
+ (set-marker min nil)
+ (set-marker max nil))))))
;;; test if a buffer is a compilation buffer, assuming we're in the buffer
(defsubst compilation-buffer-internal-p ()