(grep-process-setup) [windows-nt msdos]: Use "--color=always".
authorEli Zaretskii <eliz@gnu.org>
Sat, 28 Feb 2009 17:26:00 +0000 (17:26 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 28 Feb 2009 17:26:00 +0000 (17:26 +0000)
lisp/ChangeLog
lisp/progmodes/grep.el

index 41e7f17..5bd2e9d 100644 (file)
@@ -1,3 +1,8 @@
+2009-02-28  Eli Zaretskii  <eliz@gnu.org>
+
+       * progmodes/grep.el (grep-process-setup) [windows-nt msdos]: Use
+       "--color=always".
+
 2009-02-28  Glenn Morris  <rgm@gnu.org>
 
        * mail/rmailout.el (rmail-output-as-seen): Add autoload cookie.
index b4bcc5c..fa73f7f 100644 (file)
@@ -407,7 +407,11 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
     ;; `--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