comparison lisp/progmodes/grep.el @ 61902:e8076329ceee

(grep-mode-font-lock-keywords): Use the font-lock-face property to highlight matches.
author Lute Kamstra <lute@gnu.org>
date Thu, 28 Apr 2005 09:15:40 +0000
parents aac0a33f5772
children 37249e74aa98 08185296b491
comparison
equal deleted inserted replaced
61901:787052160d87 61902:e8076329ceee
1 ;;; grep.el --- run compiler as inferior of Emacs, parse error messages 1 ;;; grep.el --- run compiler as inferior of Emacs, parse error messages
2 2
3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 3 ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
4 ;; 2001, 2002, 2004 Free Software Foundation, Inc. 4 ;; 2001, 2002, 2004, 2005 Free Software Foundation, Inc.
5 5
6 ;; Author: Roland McGrath <roland@gnu.org> 6 ;; Author: Roland McGrath <roland@gnu.org>
7 ;; Maintainer: FSF 7 ;; Maintainer: FSF
8 ;; Keywords: tools, processes 8 ;; Keywords: tools, processes
9 9
292 (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)
293 (1 compilation-warning-face) 293 (1 compilation-warning-face)
294 (2 compilation-line-face)) 294 (2 compilation-line-face))
295 ;; Highlight grep matches and delete markers 295 ;; Highlight grep matches and delete markers
296 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)" 296 ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\(\033\\[K\\)?\\)"
297 (2 grep-match-face) 297 ;; Refontification does not work after the markers have been
298 ;; deleted. So we use the font-lock-face property here as Font
299 ;; Lock does not clear that.
300 (2 (list 'face nil 'font-lock-face grep-match-face))
298 ((lambda (p)) 301 ((lambda (p))
299 (progn 302 (progn
300 ;; Delete markers with `replace-match' because it updates 303 ;; Delete markers with `replace-match' because it updates
301 ;; the match-data, whereas `delete-region' would render it obsolete. 304 ;; the match-data, whereas `delete-region' would render it obsolete.
302 (replace-match "" t t nil 3) 305 (replace-match "" t t nil 3)