[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changes to emacs/lisp/progmodes/grep.el

From: Juri Linkov
Subject: Re: Changes to emacs/lisp/progmodes/grep.el
Date: Fri, 02 Jul 2004 11:48:48 +0300
User-agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3.50 (gnu/linux)

address@hidden (Daniel Pfeiffer) writes:
> Juri Linkov <address@hidden> skribis:
>> Currently I set `compilation-error-screen-columns' to nil in
>> `grep-regexp-alist', but perhaps I should use `grep-error-screen-columns'?
> Ah ha!  Grep inherits from compilation, so all the like-named variables get
> passed through.  As for your setting this on every match, I don't see the
> point, not even setting this once.  This is an option, which means that people
> could set it to match the understanding of whatever external prog they use.

If grep output contains at least one escape sequence used to surround
the matching string, `compilation-error-screen-columns' should be set
to nil, because the rule in `grep-regexp-alist' calculates the column
positions of matches by subtracting the position of the first character
after the file name and line number from the position of the first escape
sequence, so these calculations are based on character positions, not
on screen columns.  This means that to find correct columns in the
source buffers compilation-error-screen-columns should be nil to
interpret calculated column numbers as characters.

>> +     (4 (list 'face nil 'invisible t 'intangible t))
>> +     (5 (list 'face compilation-column-face))
>> +     (6 (list 'face nil 'invisible t 'intangible t))
> I've simplified these a little and made the face customizable, defaulting to
> isearch's.

isearch-lazy-highlight-face makes more sense since it is already used
to highlight multiple matches in isearch mode which will be similar to
matches in the grep buffer.

>> diff -u -r1.322 compile.el
>> --- lisp/progmodes/compile.el        18 Jun 2004 23:00:46 -0000      1.322
>> +++ lisp/progmodes/compile.el        30 Jun 2004 03:35:13 -0000
>> +    (overlay-put compilation-highlight-overlay 'face next-error-face))
> This variable is undefined.

Sorry, that face is from another opera :-)

I posted only the relevant part of a whole patch which uses a new face
`next-error-face' and a new option `next-error-highlight' whose another
part I already posted earlier.

Juri Linkov

reply via email to

[Prev in Thread] Current Thread [Next in Thread]