]> code.delx.au - gnu-emacs/blobdiff - lisp/progmodes/grep.el
Merge from mainline.
[gnu-emacs] / lisp / progmodes / grep.el
index 4bab8a18deefc76a221ba7caf8d13d4f8a5c3ad0..a4c9b7fccba97001544aaa8be25d4af64a63f528 100644 (file)
@@ -72,7 +72,9 @@ SYMBOL should be one of `grep-command', `grep-template',
 
 Some grep programs are able to surround matches with special
 markers in grep output.  Such markers can be used to highlight
-matches in grep mode.
+matches in grep mode.  This requires `font-lock-mode' to be active
+in grep buffers, so if you have globally disabled font-lock-mode,
+you will not get highlighting.
 
 This option sets the environment variable GREP_COLORS to specify
 markers for highlighting and GREP_OPTIONS to add the --color
@@ -388,13 +390,13 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
       1 grep-error-face)
      ;; remove match from grep-regexp-alist before fontifying
      ("^Grep[/a-zA-z]* started.*"
-      (0 '(face nil message nil help-echo nil mouse-face nil) t))
+      (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t))
      ("^Grep[/a-zA-z]* finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*"
-      (0 '(face nil message nil help-echo nil mouse-face nil) t)
+      (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
       (1 compilation-info-face nil t)
       (2 compilation-warning-face nil t))
      ("^Grep[/a-zA-z]* \\(exited abnormally\\|interrupt\\|killed\\|terminated\\)\\(?:.*with code \\([0-9]+\\)\\)?.*"
-      (0 '(face nil message nil help-echo nil mouse-face nil) t)
+      (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t)
       (1 grep-error-face)
       (2 grep-error-face nil t))
      ("^.+?-[0-9]+-.*\n" (0 grep-context-face))
@@ -462,6 +464,8 @@ Set up `compilation-exit-message-function' and run `grep-setup-hook'."
   (when (eq grep-highlight-matches 'auto-detect)
     (grep-compute-defaults))
   (unless (or (eq grep-highlight-matches 'auto-detect)
+             ;; Uses font-lock to parse color escapes.  (Bug#8084)
+             (null font-lock-mode)
              (null grep-highlight-matches))
     ;; `setenv' modifies `process-environment' let-bound in `compilation-start'
     ;; Any TERM except "dumb" allows GNU grep to use `--color=auto'