Support highlighting of ripgrep output (bug#44983)
* etc/grep.txt: Add ripgrep samples. * lisp/progmodes/grep.el (grep-match-regexp): Highlight ripgrep matches too. (grep-regexp-alist): Remove $ to highlight ripgrep binary file matches.
This commit is contained in:
parent
ef5e0785ae
commit
303f0a19cc
3 changed files with 10 additions and 3 deletions
|
@ -85,6 +85,12 @@ git --no-pager grep -inH -p -e "org-element-map"
|
|||
lisp/org/org.el[36m=[m20969[36m=[m(defun org-fill-paragraph (&optional justify)
|
||||
lisp/org/org.el[36m:[m21047[36m:[m ([1;31morg-element-map[m
|
||||
|
||||
* ripgrep
|
||||
|
||||
rg -nH --color always --no-heading -e grep-match-regexp
|
||||
[0m[35mlisp/progmodes/grep.el[0m:[0m[32m608[0m: (while (re-search-forward [0m[1m[31mgrep-match-regexp[0m end 1)
|
||||
Binary file emacs.info matches (found "\u{0}" byte around offset 2222525)
|
||||
|
||||
* unknown greps
|
||||
|
||||
grep -nH -e "xyzxyz" ../info/*
|
||||
|
|
|
@ -100,7 +100,7 @@ To change the default value, use \\[customize] or call the function
|
|||
:set #'grep-apply-setting
|
||||
:version "22.1")
|
||||
|
||||
(defcustom grep-match-regexp "\033\\[0?1;31m\\(.*?\\)\033\\[[0-9]*m"
|
||||
(defcustom grep-match-regexp "\033\\[\\(?:0?1;\\)?31m\\(.*?\\)\033\\[[0-9]*m"
|
||||
"Regular expression matching grep markers to highlight.
|
||||
It matches SGR ANSI escape sequences which are emitted by grep to
|
||||
color its output. This variable is used in `grep-filter'."
|
||||
|
@ -412,7 +412,7 @@ Notice that using \\[next-error] or \\[compile-goto-error] modifies
|
|||
(- mend beg))))))
|
||||
nil nil
|
||||
(3 '(face nil display ":")))
|
||||
("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
|
||||
("^Binary file \\(.+\\) matches" 1 nil nil 0 1))
|
||||
"Regexp used to match grep hits.
|
||||
See `compilation-error-regexp-alist' for format details.")
|
||||
|
||||
|
|
|
@ -113,7 +113,8 @@ $EMACS_HYDRA_CI indicates the hydra environment, and $EMACS_EMBA_CI
|
|||
indicates the emba environment, respectively.
|
||||
|
||||
|
||||
(Also, see etc/compilation.txt for compilation mode font lock tests.)
|
||||
(Also, see etc/compilation.txt for compilation mode font lock tests
|
||||
and etc/grep.txt for grep mode font lock tests.)
|
||||
|
||||
|
||||
This file is part of GNU Emacs.
|
||||
|
|
Loading…
Add table
Reference in a new issue