Commit 35952129 authored by Juri Linkov's avatar Juri Linkov
Browse files

(grep-regexp-alist): Replace complex regexp

matching line numbers, column numbers and their ranges with regexp
matching only line numbers.
(grep-context-face): New face variable.
(grep-mode-font-lock-keywords): Use it.
parent 81435dc4
2005-08-04 Juri Linkov <juri@jurta.org>
* progmodes/grep.el (grep-regexp-alist): Replace complex regexp
matching line numbers, column numbers and their ranges with regexp
matching only line numbers.
(grep-context-face): New face variable.
(grep-mode-font-lock-keywords): Use it.
* faces.el (read-face-name): Delete duplicate faces.
2005-08-02 Juanma Barranquero <lekktu@gmail.com> 2005-08-02 Juanma Barranquero <lekktu@gmail.com>
   
* thumbs.el (thumbs-find-image): Don't make variables * thumbs.el (thumbs-find-image): Don't make variables
...@@ -234,8 +244,6 @@ ...@@ -234,8 +244,6 @@
   
2005-07-22 Juri Linkov <juri@jurta.org> 2005-07-22 Juri Linkov <juri@jurta.org>
   
* simple.el (line-move-1): Fix comments.
* startup.el (normal-splash-screen): Update menu name. * startup.el (normal-splash-screen): Update menu name.
   
* tempo.el (tempo-insert-template): Fix 2005-07-16 change. * tempo.el (tempo-insert-template): Fix 2005-07-16 change.
......
...@@ -248,13 +248,12 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies ...@@ -248,13 +248,12 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
;;;###autoload ;;;###autoload
(defvar grep-regexp-alist (defvar grep-regexp-alist
;; rms: I removed the code to match parens around the line number '(("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2"
;; because it causes confusion and so we will find out if anyone needs it. 1 3)
;; It causes confusion with a file name that contains a number in parens. ;; Rule to match column numbers is commented out since no known grep
'(("^\\(.+?\\)\\([: \t]\\)+\ ;; produces them
\\([0-9]+\\)\\([.:]?\\)\\([0-9]+\\)?\ ;; ("^\\([^:\n]+\\)\\(:[ \t]*\\)\\([0-9]+\\)\\2\\(?:\\([0-9]+\\)\\(?:-\\([0-9]+\\)\\)?\\2\\)?"
\\(?:-\\(?:\\([0-9]+\\)\\4\\)?\\.?\\([0-9]+\\)?\\)?\\2" ;; 1 3 (4 . 5))
1 (3 . 6) (5 . 7))
("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\ ("^\\(\\(.+?\\):\\([0-9]+\\):\\).*?\
\\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" \\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
2 3 2 3
...@@ -284,6 +283,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies ...@@ -284,6 +283,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
(defvar grep-match-face 'match (defvar grep-match-face 'match
"Face name to use for grep matches.") "Face name to use for grep matches.")
(defvar grep-context-face 'shadow
"Face name to use for grep context lines.")
(defvar grep-mode-font-lock-keywords (defvar grep-mode-font-lock-keywords
'(;; Command output lines. '(;; Command output lines.
("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face) ("^\\([A-Za-z_0-9/\.+-]+\\)[ \t]*:" 1 font-lock-function-name-face)
...@@ -298,6 +300,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies ...@@ -298,6 +300,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
(0 '(face nil message nil help-echo nil mouse-face nil) t) (0 '(face nil message nil help-echo nil mouse-face nil) t)
(1 grep-error-face) (1 grep-error-face)
(2 grep-error-face)) (2 grep-error-face))
("^[^\n-]+-[0-9]+-.*" (0 grep-context-face))
;; Highlight grep matches and delete markers ;; Highlight grep matches and delete markers
("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)" ("\\(\033\\[01;31m\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
;; Refontification does not work after the markers have been ;; Refontification does not work after the markers have been
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment