emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/grep.el,v


From: Juri Linkov
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/grep.el,v
Date: Fri, 23 Nov 2007 00:32:06 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Juri Linkov <jurta>     07/11/23 00:32:06

Index: grep.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/grep.el,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -b -r1.80 -r1.81
--- grep.el     20 Nov 2007 16:38:23 -0000      1.80
+++ grep.el     23 Nov 2007 00:32:05 -0000      1.81
@@ -371,11 +371,16 @@
   (unless (or (not grep-highlight-matches) (eq grep-highlight-matches t))
     (grep-compute-defaults))
   (when (eq grep-highlight-matches t)
-    ;; Modify `process-environment' locally bound in `compilation-start'
-    (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=always"))
-    ;; for GNU grep 2.5.1
+    ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
+    ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'
+    (setenv "TERM" "emacs-grep")
+    ;; `--color=auto' emits escape sequences on a tty rather than on a pipe,
+    ;; thus allowing to use multiple grep filters on the command line
+    ;; and to output escape sequences only on the final grep output
+    (setenv "GREP_OPTIONS" (concat (getenv "GREP_OPTIONS") " --color=auto"))
+    ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions
     (setenv "GREP_COLOR" "01;31")
-    ;; for GNU grep 2.5.1-cvs
+    ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions
     (setenv "GREP_COLORS" "mt=01;31:fn=:ln=:bn=:se=:ml=:cx=:ne"))
   (set (make-local-variable 'compilation-exit-message-function)
        (lambda (status code msg)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]