diff options
| author | Juri Linkov | 2004-10-28 09:00:26 +0000 |
|---|---|---|
| committer | Juri Linkov | 2004-10-28 09:00:26 +0000 |
| commit | 1bcd42e2fe8c27c18c8f08f6dfb04c6a98cca8e1 (patch) | |
| tree | 97c16268c77a3616a9e16bd3d1f52de99a3c1147 | |
| parent | f4982064348329e9d22e68ee7d057d58b99f10fb (diff) | |
| download | emacs-1bcd42e2fe8c27c18c8f08f6dfb04c6a98cca8e1.tar.gz emacs-1bcd42e2fe8c27c18c8f08f6dfb04c6a98cca8e1.zip | |
(grep-regexp-alist): Move match highlighting
code to `grep-mode-font-lock-keywords'.
(grep-mode-font-lock-keywords): Delete grep markers instead
of making them invisible.
| -rw-r--r-- | lisp/progmodes/grep.el | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 4d9e05109a8..71927642a96 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el | |||
| @@ -1,7 +1,7 @@ | |||
| 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, 86, 87, 93, 94, 95, 96, 97, 98, 1999, 2001, 02, 2004 | 3 | ;; Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, 1998, 1999, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2001, 2002, 2004 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 |
| @@ -252,21 +252,12 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 252 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6)) | 252 | \\(?:-\\(?:\\([0-9]+\\)\\3\\)?\\.?\\([0-9]+\\)?\\)?[:) \t]" 1 (2 . 5) (4 . 6)) |
| 253 | ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | 253 | ("^\\(.+?\\)[:(]+\\([0-9]+\\)\\([:)]\\).*?\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" |
| 254 | 1 2 | 254 | 1 2 |
| 255 | ;; Calculate column positions (beg . end) of first grep match on a line | ||
| 255 | ((lambda () | 256 | ((lambda () |
| 256 | (setq compilation-error-screen-columns nil) | 257 | (setq compilation-error-screen-columns nil) |
| 257 | (- (match-beginning 5) (match-end 3) 8)) | 258 | (- (match-beginning 5) (match-end 3) 8)) |
| 258 | . | 259 | . |
| 259 | (lambda () (- (match-end 5) (match-end 3) 8))) | 260 | (lambda () (- (match-end 5) (match-end 3) 8)))) |
| 260 | nil nil | ||
| 261 | (4 (list 'face nil 'invisible t 'intangible t)) | ||
| 262 | (5 (list 'face compilation-column-face)) | ||
| 263 | (6 (list 'face nil 'invisible t 'intangible t)) | ||
| 264 | ;; highlight other matches on the same line | ||
| 265 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | ||
| 266 | nil nil | ||
| 267 | (1 (list 'face nil 'invisible t 'intangible t)) | ||
| 268 | (2 (list 'face compilation-column-face) t) | ||
| 269 | (3 (list 'face nil 'invisible t 'intangible t)))) | ||
| 270 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) | 261 | ("^Binary file \\(.+\\) matches$" 1 nil nil 1)) |
| 271 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") | 262 | "Regexp used to match grep hits. See `compilation-error-regexp-alist'.") |
| 272 | 263 | ||
| @@ -294,7 +285,16 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies | |||
| 294 | ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" | 285 | ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" |
| 295 | (0 '(face nil message nil help-echo nil mouse-face nil) t) | 286 | (0 '(face nil message nil help-echo nil mouse-face nil) t) |
| 296 | (1 compilation-warning-face) | 287 | (1 compilation-warning-face) |
| 297 | (2 compilation-line-face))) | 288 | (2 compilation-line-face)) |
| 289 | ;; Highlight grep matches and delete markers | ||
| 290 | ("\\(\033\\[01;41m\\)\\(.*?\\)\\(\033\\[00m\\)" | ||
| 291 | (2 compilation-column-face) | ||
| 292 | ((lambda (p)) | ||
| 293 | (progn | ||
| 294 | ;; Delete markers with `replace-match' because it updates | ||
| 295 | ;; the match-data, whereas `delete-region' would render it obsolete. | ||
| 296 | (replace-match "" t t nil 3) | ||
| 297 | (replace-match "" t t nil 1))))) | ||
| 298 | "Additional things to highlight in grep output. | 298 | "Additional things to highlight in grep output. |
| 299 | This gets tacked on the end of the generated expressions.") | 299 | This gets tacked on the end of the generated expressions.") |
| 300 | 300 | ||