diff options
author | Dave Love <fx@gnu.org> | 1998-02-09 19:40:38 +0000 |
---|---|---|
committer | Dave Love <fx@gnu.org> | 1998-02-09 19:40:38 +0000 |
commit | b5812513a487b49af64d1db729e6c93368cedb71 (patch) | |
tree | 621192657a7f1d07c0cf1311b49b3cda7654c911 /lisp/progmodes/compile.el | |
parent | 529724fec7ce48fe562991a753736da2009bb7df (diff) | |
download | emacs-b5812513a487b49af64d1db729e6c93368cedb71.tar.gz |
(compilation-scroll-output): New variable.
(compile-internal): Use it. Set lazy-lock-defer-on-scrolling.
Diffstat (limited to 'lisp/progmodes/compile.el')
-rw-r--r-- | lisp/progmodes/compile.el | 23 |
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))) |