[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: problem with recent change to grep-regexp-alist
From: |
Juri Linkov |
Subject: |
Re: problem with recent change to grep-regexp-alist |
Date: |
Wed, 10 Aug 2005 07:02:48 +0300 |
User-agent: |
Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (gnu/linux) |
>> One way to resolve them is to match markup escape sequences that new
>> GNU grep puts around file names and line numbers. You can see them in
>> grep.txt under the title `GNU grep 2.5.1-cvs with default colors'.
>
> I'm aware of them, are you waiting for the 2.5.2 release to add the
> corresponding element to grep-regexp-alist?
I am not sure it's good to recognize rare cases at the cost of the
overhead of processing these additional escape sequences for file
names and line numbers. But this is possible with
GREP_COLORS='mt=01;31:fn=35:ln=32:bn=:se=:ml=36:cx=37:ne'
and the regexp
("^\\(\033\\[35m\\(.+?\\)\033\\[m.*?\033\\[32m\\([0-9]+\\)\033\\[m.*?\033\\[36m\\).*?\
\\(\033\\[01;31m\\(?:\033\\[K\\)?\\)\\(.*?\\)\\(\033\\[[0-9]*m\\)"
2 3
;; Calculate column positions (beg . end) of first grep match on a line
((lambda ()
(setq compilation-error-screen-columns nil)
(- (match-beginning 4) (match-end 1)))
.
(lambda () (- (match-end 5) (match-end 1)
(- (match-end 4) (match-beginning 4)))))
nil 1)
But it still doesn't fontifify grep matches correctly because other
font-lock rules interfere.
--
Juri Linkov
http://www.jurta.org/emacs/
Re: problem with recent change to grep-regexp-alist, Stefan Monnier, 2005/08/09