summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Love <fx@gnu.org>1998-02-09 19:40:38 +0000
committerDave Love <fx@gnu.org>1998-02-09 19:40:38 +0000
commit25a8d82036ec1001f07c4ce20b91b37f2e52b492 (patch)
treed5b7697a63232e92127d3c53fca4679a3eee5bd6
parentb848fa0cea2196f9c6a2be96a54a8c1fe8ce2099 (diff)
downloademacs-25a8d82036ec1001f07c4ce20b91b37f2e52b492.tar.gz
(compilation-scroll-output): New variable.
(compile-internal): Use it. Set lazy-lock-defer-on-scrolling.
-rw-r--r--lisp/progmodes/compile.el23
1 files changed, 21 insertions, 2 deletions
diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el
index 0541257b0a6..7b9b9085b36 100644
--- a/lisp/progmodes/compile.el
+++ b/lisp/progmodes/compile.el
@@ -1,6 +1,6 @@
;;; compile.el --- run compiler as inferior of Emacs, parse error messages.
-;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 1997 Free Software Foundation, Inc.
+;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc.
;; Author: Roland McGrath <roland@prep.ai.mit.edu>
;; Maintainer: FSF
@@ -580,6 +580,16 @@ easily repeat a find command."
(let ((grep-null-device nil)) ; see grep
(grep command-args)))
+(defcustom compilation-scroll-output nil
+ "*Non-nil to scroll the *compilation* buffer window as output appears.
+
+Setting it causes the compilation-mode commands to put point at the
+end of their output window so that the end of the output is always
+visible rather than the begining."
+ :type 'boolean
+ :version 20.3
+ :group 'compilation)
+
(defun compile-internal (command error-message
&optional name-of-mode parser
error-regexp-alist name-function
@@ -686,6 +696,10 @@ Returns the compilation buffer created."
error-regexp-alist name-function
enter-regexp-alist leave-regexp-alist
file-regexp-alist nomessage-regexp-alist))
+ (make-local-variable 'lazy-lock-defer-on-scrolling)
+ ;; This proves a good idea if the buffer's going to scroll
+ ;; with lazy-lock on.
+ (setq lazy-lock-defer-on-scrolling t)
(setq default-directory thisdir
compilation-directory-stack (list default-directory))
(set-window-start outwin (point-min))
@@ -726,7 +740,12 @@ exited abnormally with code %d\n"
(concat status "\n")))
(t
(compilation-handle-exit 'bizarre status status))))
- (message "Executing `%s'...done" command))))
+ (message "Executing `%s'...done" command)))
+ (if compilation-scroll-output
+ (let ((currbuf (current-buffer)))
+ (select-window outwin)
+ (goto-char (point-max))
+ (select-window (get-buffer-window currbuf)))))
;; Make it so the next C-x ` will use this buffer.
(setq compilation-last-buffer outbuf)))