aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuri Linkov2005-08-25 19:09:22 +0000
committerJuri Linkov2005-08-25 19:09:22 +0000
commit19b3905f262a17d4dcedabf2eda692b08f1d1ef2 (patch)
treec028dddb686bcf23f21e563836f2c165e6f65f06
parentd09058217d37eca04aa0f8be8cecbc48ee26f09c (diff)
downloademacs-19b3905f262a17d4dcedabf2eda692b08f1d1ef2.tar.gz
emacs-19b3905f262a17d4dcedabf2eda692b08f1d1ef2.zip
(grep, grep-mode): Make buffer-local variables
compilation-process-setup-function and compilation-disable-input in grep-mode instead of let-bindings in grep.
-rw-r--r--lisp/progmodes/grep.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 5c3ce5ec34c..6dc5fcabd41 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -287,7 +287,8 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
287 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" 287 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$"
288 1 grep-error-face) 288 1 grep-error-face)
289 ;; remove match from grep-regexp-alist before fontifying 289 ;; remove match from grep-regexp-alist before fontifying
290 ("^Grep started.*" (0 '(face nil message nil help-echo nil mouse-face nil) t)) 290 ("^Grep started.*"
291 (0 '(face nil message nil help-echo nil mouse-face nil) t))
291 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" 292 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*"
292 (0 '(face nil message nil help-echo nil mouse-face nil) t) 293 (0 '(face nil message nil help-echo nil mouse-face nil) t)
293 (1 compilation-info-face nil t) 294 (1 compilation-info-face nil t)
@@ -517,12 +518,10 @@ temporarily highlight in visited source lines."
517 518
518 ;; Setting process-setup-function makes exit-message-function work 519 ;; Setting process-setup-function makes exit-message-function work
519 ;; even when async processes aren't supported. 520 ;; even when async processes aren't supported.
520 (let ((compilation-process-setup-function 'grep-process-setup) 521 (compilation-start (if (and grep-use-null-device null-device)
521 (compilation-disable-input t)) 522 (concat command-args " " null-device)
522 (compilation-start (if (and grep-use-null-device null-device) 523 command-args)
523 (concat command-args " " null-device) 524 'grep-mode nil highlight-regexp))
524 command-args)
525 'grep-mode nil highlight-regexp)))
526 525
527;;;###autoload 526;;;###autoload
528(define-compilation-mode grep-mode "Grep" 527(define-compilation-mode grep-mode "Grep"
@@ -532,6 +531,9 @@ temporarily highlight in visited source lines."
532 grep-hit-face) 531 grep-hit-face)
533 (set (make-local-variable 'compilation-error-regexp-alist) 532 (set (make-local-variable 'compilation-error-regexp-alist)
534 grep-regexp-alist) 533 grep-regexp-alist)
534 (set (make-local-variable 'compilation-process-setup-function)
535 'grep-process-setup)
536 (set (make-local-variable 'compilation-disable-input) t)
535 ;; Set `font-lock-lines-before' to 0 to not refontify the previous 537 ;; Set `font-lock-lines-before' to 0 to not refontify the previous
536 ;; line where grep markers may be already removed. 538 ;; line where grep markers may be already removed.
537 (set (make-local-variable 'font-lock-lines-before) 0)) 539 (set (make-local-variable 'font-lock-lines-before) 0))