comparison lisp/progmodes/grep.el @ 58988:067d5dcfe531

(grep-match-face): New defvar. (grep-mode-font-lock-keywords): Use grep-match-face instead of compilation-column-face to highlight grep matches.
author Juri Linkov <juri@jurta.org>
date Thu, 16 Dec 2004 07:16:44 +0000
parents 9acfc0fb9410
children b64dd2ff73f7 eac554634bfa
comparison
equal deleted inserted replaced
58987:b24e485e88f7 58988:067d5dcfe531
273 "Face name to use for grep hits.") 273 "Face name to use for grep hits.")
274 274
275 (defvar grep-error-face compilation-error-face 275 (defvar grep-error-face compilation-error-face
276 "Face name to use for grep error messages.") 276 "Face name to use for grep error messages.")
277 277
278 (defvar grep-match-face 'match
279 "Face name to use for grep matches.")
280
278 (defvar grep-mode-font-lock-keywords 281 (defvar grep-mode-font-lock-keywords
279 '(;; Command output lines. 282 '(;; Command output lines.
280 ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face) 283 ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face)
281 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" 284 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$"
282 1 grep-error-face) 285 1 grep-error-face)
289 (0 '(face nil message nil help-echo nil mouse-face nil) t) 292 (0 '(face nil message nil help-echo nil mouse-face nil) t)
290 (1 compilation-warning-face) 293 (1 compilation-warning-face)
291 (2 compilation-line-face)) 294 (2 compilation-line-face))
292 ;; Highlight grep matches and delete markers 295 ;; Highlight grep matches and delete markers
293 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" 296 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)"
294 (2 compilation-column-face) 297 (2 grep-match-face)
295 ((lambda (p)) 298 ((lambda (p))
296 (progn 299 (progn
297 ;; Delete markers with `replace-match' because it updates 300 ;; Delete markers with `replace-match' because it updates
298 ;; the match-data, whereas `delete-region' would render it obsolete. 301 ;; the match-data, whereas `delete-region' would render it obsolete.
299 (replace-match "" t t nil 3) 302 (replace-match "" t t nil 3)