changeset 102336:83645050eee3

(grep-process-setup) [windows-nt msdos]: Use "--color=always".
author Eli Zaretskii <eliz@gnu.org>
date Sat, 28 Feb 2009 17:24:29 +0000
parents 1cabc699e9e6
children 93930b5cd2e8
files lisp/progmodes/grep.el
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/grep.el	Sat Feb 28 15:53:11 2009 +0000
+++ b/lisp/progmodes/grep.el	Sat Feb 28 17:24:29 2009 +0000
@@ -407,7 +407,11 @@
     ;; `--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"))
+    (setenv "GREP_OPTIONS"
+	    (concat (getenv "GREP_OPTIONS")
+		    ;; Windows and DOS pipes fail `isatty' detection in Grep.
+		    " --color=" (if (memq system-type '(windows-nt ms-dos))
+				    "always" "auto")))
     ;; GREP_COLOR is used in GNU grep 2.5.1, but deprecated in later versions
     (setenv "GREP_COLOR" "01;31")
     ;; GREP_COLORS is used in GNU grep 2.5.2 and later versions