From 7a1d7ba7d22e9d82fdde0bc6e9fcc5152a7c9670 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Fri, 24 May 2013 23:54:38 +0300 Subject: [PATCH] * lisp/progmodes/grep.el (grep-mode-font-lock-keywords): Support =linenumber= format used by git-grep for lines with function names. Fixes: debbugs:13549 --- etc/grep.txt | 8 ++++++++ lisp/ChangeLog | 6 ++++++ lisp/progmodes/grep.el | 4 +++- 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/etc/grep.txt b/etc/grep.txt index 70f250101f..86f725899e 100644 --- a/etc/grep.txt +++ b/etc/grep.txt @@ -72,6 +72,14 @@ Grep finished (matches found) at Thu Jul 21 15:02:15 agrep -n "INFO tree" ../info/* ../info/dir: 6: File: dir Node: Top This is the top of the INFO tree +* git-grep + with `[diff "el"] xfuncname = "^(\\(.*)$"' in .gitconfig + and `*.el diff=el' in .gitattributes + +git grep -inH -p -e "org-element-map" +lisp/org/org.el=20969=(defun org-fill-paragraph (&optional justify) +lisp/org/org.el:21047: (org-element-map + * unknown greps grep -nH -e "xyzxyz" ../info/* diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2495620ef1..e12652e7cb 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2013-05-24 Juri Linkov + + * progmodes/grep.el (grep-mode-font-lock-keywords): + Support =linenumber= format used by git-grep for lines with + function names. (Bug#13549) + 2013-05-24 Stefan Monnier * progmodes/octave.el (octave-smie-rules): Return nil rather than diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el index 1e152c6d75..46af51e1f9 100644 --- a/lisp/progmodes/grep.el +++ b/lisp/progmodes/grep.el @@ -410,7 +410,9 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies (0 '(face nil compilation-message nil help-echo nil mouse-face nil) t) (1 grep-error-face) (2 grep-error-face nil t)) - ("^.+?-[0-9]+-.*\n" (0 grep-context-face))) + ;; "filename-linenumber-" format is used for context lines in GNU grep, + ;; "filename=linenumber=" for lines with function names in "git grep -p". + ("^.+?[-=][0-9]+[-=].*\n" (0 grep-context-face))) "Additional things to highlight in grep output. This gets tacked on the end of the generated expressions.") -- 2.20.1