Mercurial > emacs
comparison lisp/progmodes/grep.el @ 64864:c474b6f22449
(grep-regexp-alist): Use `.+?' instead of `[^:\n]+'.
(grep-mode-font-lock-keywords): Use `.+?' instead of `[^\n-]+'.
(grep-error-face): Set to `compilation-error' instead of
`compilation-error-face' (which is redefined to `grep-hit-face' in
grep buffers).
(grep-mode-font-lock-keywords): Remove `-text' from face
variable names. Use `grep-error-face' instead of
`compilation-error-text-face'.
author | Juri Linkov <juri@jurta.org> |
---|---|
date | Tue, 09 Aug 2005 21:37:34 +0000 |
parents | eeed7a7c1afa |
children | c845f6151d83 |
comparison
equal
deleted
inserted
replaced
64863:2838cf662e70 | 64864:c474b6f22449 |
---|---|
242 Notice that using \\[next-error] or \\[compile-goto-error] modifies | 242 Notice that using \\[next-error] or \\[compile-goto-error] modifies |
243 `complation-last-buffer' rather than `grep-last-buffer'.") | 243 `complation-last-buffer' rather than `grep-last-buffer'.") |
244 | 244 |
245 ;;;###autoload | 245 ;;;###autoload |
246 (defvar grep-regexp-alist | 246 (defvar grep-regexp-alist |
247 '(("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2" | 247 '(("^\\(.+?\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2" |
248 1 3) | 248 1 3) |
249 ;; Rule to match column numbers is commented out since no known grep | 249 ;; Rule to match column numbers is commented out since no known grep |
250 ;; produces them | 250 ;; produces them |
251 ;; ("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?" | 251 ;; ("^\\(.+?\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?" |
252 ;; 1 3 (4 . 5)) | 252 ;; 1 3 (4 . 5)) |
253 ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ | 253 ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ |
254 \\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" | 254 \\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" |
255 2 3 | 255 2 3 |
256 ;; Calculate column positions (beg . end) of first grep match on a line | 256 ;; Calculate column positions (beg . end) of first grep match on a line |
270 ;; Reverse the colors because grep hits are not errors (though we jump there | 270 ;; Reverse the colors because grep hits are not errors (though we jump there |
271 ;; with `next-error'), and unreadable files can't be gone to. | 271 ;; with `next-error'), and unreadable files can't be gone to. |
272 (defvar grep-hit-face compilation-info-face | 272 (defvar grep-hit-face compilation-info-face |
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 |
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 | 278 (defvar grep-match-face 'match |
279 "Face name to use for grep matches.") | 279 "Face name to use for grep matches.") |
280 | 280 |
287 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" | 287 (": \\(.+\\): \\(?:Permission denied\\|No such \\(?:file or directory\\|device or address\\)\\)$" |
288 1 grep-error-face) | 288 1 grep-error-face) |
289 ;; remove match from grep-regexp-alist before fontifying | 289 ;; remove match from grep-regexp-alist before fontifying |
290 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" | 290 ("^Grep finished \\(?:(\\(matches found\\))\\|with \\(no matches found\\)\\).*" |
291 (0 '(face nil message nil help-echo nil mouse-face nil) t) | 291 (0 '(face nil message nil help-echo nil mouse-face nil) t) |
292 (1 compilation-info-text-face nil t) | 292 (1 compilation-info-face nil t) |
293 (2 compilation-warning-text-face nil t)) | 293 (2 compilation-warning-face nil t)) |
294 ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" | 294 ("^Grep \\(exited abnormally\\) with code \\([0-9]+\\).*" |
295 (0 '(face nil message nil help-echo nil mouse-face nil) t) | 295 (0 '(face nil message nil help-echo nil mouse-face nil) t) |
296 (1 compilation-error-text-face) | 296 (1 grep-error-face) |
297 (2 compilation-error-text-face)) | 297 (2 grep-error-face)) |
298 ("^[^\n-]+-[0-9]+-.*" (0 grep-context-face)) | 298 ("^.+?-[0-9]+-.*\n" (0 grep-context-face)) |
299 ;; Highlight grep matches and delete markers | 299 ;; Highlight grep matches and delete markers |
300 ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" | 300 ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" |
301 ;; Refontification does not work after the markers have been | 301 ;; Refontification does not work after the markers have been |
302 ;; deleted. So we use the font-lock-face property here as Font | 302 ;; deleted. So we use the font-lock-face property here as Font |
303 ;; Lock does not clear that. | 303 ;; Lock does not clear that. |