+(defvar grep-error "grep hit"
+ "Message to print when no matches are found.")
+
+;; Reverse the colors because grep hits are not errors (though we jump there
+;; with `next-error'), and unreadable files can't be gone to.
+(defvar grep-hit-face compilation-info-face
+ "Face name to use for grep hits.")
+
+(defvar grep-error-face compilation-error-face
+ "Face name to use for grep error messages.")
+
+(defvar grep-mode-font-lock-keywords
+ '(;; Command output lines.
+ ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face)
+ (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$"
+ 1 grep-error-face)
+ ;; remove match from grep-regexp-alist before fontifying
+ ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*"
+ (0 '(face nil message nil help-echo nil mouse-face nil) t)
+ (1 grep-hit-face nil t)
+ (2 grep-error-face nil t))
+ ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*"
+ (0 '(face nil message nil help-echo nil mouse-face nil) t)
+ (1 compilation-warning-face)
+ (2 compilation-line-face))
+ ;; Highlight grep matches and delete markers
+ ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)"
+ (2 compilation-column-face)
+ ((lambda (p))
+ (progn
+ ;; Delete markers with `replace-match' because it updates
+ ;; the match-data, whereas `delete-region' would render it obsolete.
+ (replace-match "" t t nil 3)
+ (replace-match "" t t nil 1)))))
+ "Additional things to highlight in grep output.
+This gets tacked on the end of the generated expressions.")
+
+;;;###autoload