Mercurial > emacs
comparison lisp/progmodes/compile.el @ 20877:4b22b9a5bd8e
(compilation-scroll-output): New variable.
(compile-internal): Use it. Set lazy-lock-defer-on-scrolling.
author | Dave Love <fx@gnu.org> |
---|---|
date | Mon, 09 Feb 1998 19:40:38 +0000 |
parents | 0ee26e03e911 |
children | 1abf4d6ec488 |
comparison
equal
deleted
inserted
replaced
20876:c80b908e5af5 | 20877:4b22b9a5bd8e |
---|---|
1 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages. | 1 ;;; compile.el --- run compiler as inferior of Emacs, parse error messages. |
2 | 2 |
3 ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. | 3 ;; Copyright (C) 1985, 86, 87, 93, 94, 95, 96, 97, 1998 Free Software Foundation, Inc. |
4 | 4 |
5 ;; Author: Roland McGrath <roland@prep.ai.mit.edu> | 5 ;; Author: Roland McGrath <roland@prep.ai.mit.edu> |
6 ;; Maintainer: FSF | 6 ;; Maintainer: FSF |
7 ;; Keywords: tools, processes | 7 ;; Keywords: tools, processes |
8 | 8 |
577 (interactive | 577 (interactive |
578 (list (read-from-minibuffer "Run find (like this): " | 578 (list (read-from-minibuffer "Run find (like this): " |
579 grep-find-command nil nil 'grep-find-history))) | 579 grep-find-command nil nil 'grep-find-history))) |
580 (let ((grep-null-device nil)) ; see grep | 580 (let ((grep-null-device nil)) ; see grep |
581 (grep command-args))) | 581 (grep command-args))) |
582 | |
583 (defcustom compilation-scroll-output nil | |
584 "*Non-nil to scroll the *compilation* buffer window as output appears. | |
585 | |
586 Setting it causes the compilation-mode commands to put point at the | |
587 end of their output window so that the end of the output is always | |
588 visible rather than the begining." | |
589 :type 'boolean | |
590 :version 20.3 | |
591 :group 'compilation) | |
582 | 592 |
583 (defun compile-internal (command error-message | 593 (defun compile-internal (command error-message |
584 &optional name-of-mode parser | 594 &optional name-of-mode parser |
585 error-regexp-alist name-function | 595 error-regexp-alist name-function |
586 enter-regexp-alist leave-regexp-alist | 596 enter-regexp-alist leave-regexp-alist |
684 (list command error-message | 694 (list command error-message |
685 name-of-mode parser | 695 name-of-mode parser |
686 error-regexp-alist name-function | 696 error-regexp-alist name-function |
687 enter-regexp-alist leave-regexp-alist | 697 enter-regexp-alist leave-regexp-alist |
688 file-regexp-alist nomessage-regexp-alist)) | 698 file-regexp-alist nomessage-regexp-alist)) |
699 (make-local-variable 'lazy-lock-defer-on-scrolling) | |
700 ;; This proves a good idea if the buffer's going to scroll | |
701 ;; with lazy-lock on. | |
702 (setq lazy-lock-defer-on-scrolling t) | |
689 (setq default-directory thisdir | 703 (setq default-directory thisdir |
690 compilation-directory-stack (list default-directory)) | 704 compilation-directory-stack (list default-directory)) |
691 (set-window-start outwin (point-min)) | 705 (set-window-start outwin (point-min)) |
692 (setq mode-name name-of-mode) | 706 (setq mode-name name-of-mode) |
693 (or (eq outwin (selected-window)) | 707 (or (eq outwin (selected-window)) |
724 ((stringp status) | 738 ((stringp status) |
725 (compilation-handle-exit 'signal status | 739 (compilation-handle-exit 'signal status |
726 (concat status "\n"))) | 740 (concat status "\n"))) |
727 (t | 741 (t |
728 (compilation-handle-exit 'bizarre status status)))) | 742 (compilation-handle-exit 'bizarre status status)))) |
729 (message "Executing `%s'...done" command)))) | 743 (message "Executing `%s'...done" command))) |
744 (if compilation-scroll-output | |
745 (let ((currbuf (current-buffer))) | |
746 (select-window outwin) | |
747 (goto-char (point-max)) | |
748 (select-window (get-buffer-window currbuf))))) | |
730 ;; Make it so the next C-x ` will use this buffer. | 749 ;; Make it so the next C-x ` will use this buffer. |
731 (setq compilation-last-buffer outbuf))) | 750 (setq compilation-last-buffer outbuf))) |
732 | 751 |
733 ;; Set the height of WINDOW according to compilation-window-height. | 752 ;; Set the height of WINDOW according to compilation-window-height. |
734 (defun compilation-set-window-height (window) | 753 (defun compilation-set-window-height (window) |