Mercurial > emacs
changeset 65126:559a37c2f306
(grep, grep-mode): Make buffer-local variables
compilation-process-setup-function and compilation-disable-input
in grep-mode instead of let-bindings in grep.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Thu, 25 Aug 2005 19:09:22 +0000 |
parents | bb897fec166c |
children | 7adadc9e4a10 |
files | lisp/progmodes/grep.el |
diffstat | 1 files changed, 9 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/grep.el Thu Aug 25 17:04:43 2005 +0000 +++ b/lisp/progmodes/grep.el Thu Aug 25 19:09:22 2005 +0000 @@ -287,7 +287,8 @@ (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" 1 grep-error-face) ;; remove match from grep-regexp-alist before fontifying - ("^Grep started.*" (0 '(face nil message nil help-echo nil mouse-face nil) t)) + ("^Grep started.*" + (0 '(face nil message nil help-echo nil mouse-face nil) t)) ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" (0 '(face nil message nil help-echo nil mouse-face nil) t) (1 compilation-info-face nil t) @@ -517,12 +518,10 @@ ;; Setting process-setup-function makes exit-message-function work ;; even when async processes aren't supported. - (let ((compilation-process-setup-function 'grep-process-setup) - (compilation-disable-input t)) - (compilation-start (if (and grep-use-null-device null-device) - (concat command-args " " null-device) - command-args) - 'grep-mode nil highlight-regexp))) + (compilation-start (if (and grep-use-null-device null-device) + (concat command-args " " null-device) + command-args) + 'grep-mode nil highlight-regexp)) ;;;###autoload (define-compilation-mode grep-mode "Grep" @@ -532,6 +531,9 @@ grep-hit-face) (set (make-local-variable 'compilation-error-regexp-alist) grep-regexp-alist) + (set (make-local-variable 'compilation-process-setup-function) + 'grep-process-setup) + (set (make-local-variable 'compilation-disable-input) t) ;; Set `font-lock-lines-before' to 0 to not refontify the previous ;; line where grep markers may be already removed. (set (make-local-variable 'font-lock-lines-before) 0))