emacs-devel
[Top][All Lists]
Advanced

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

Re: Fwd: Re: junk in *grep* buffers


From: Lute Kamstra
Subject: Re: Fwd: Re: junk in *grep* buffers
Date: Wed, 27 Apr 2005 13:29:34 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> When I do M-x grep and use
>>
>>   grep -nH -e "(define-minor-mode" lisp/*.el
>>
>> I get a *grep* buffer with occurrences of "(define-minor-mode" in lisp
>> files.  Every time that I tried, most lines in this buffer give the
>> text "(define-minor-mode" the grep-match-face, but a few lines don't
>> fontify "(define-minor-mode".  The strange thing is that the lines
>> that don't fontify "(define-minor-mode" are different every time I
>> invoke grep.
>
> The problem, most likely is the following:
>
> 1 - grep sends a partial line like
>
>      foo:123:toto \033[01;41mMATCH\033[00m
>
> 2 - font-lock fontifies this, which adds a face property and removes
>     the markers, so the text is now:
>
>      foo:123:toto MATCH
>
> 3 - grep sends the rest of the line
>
>      bar baz\n
>
>     so the complete line is now
>
>      foo:123:toto MATCH bar baz\n
>
> 4 - font-lock is triggered again to fontify the added text, but it works
>     a line-at-a-time so it re-fontifies the whole line, what begins by
>     removing the `face' property and never re-adds it since the merkers are
>     now lost.
>
> So the patch below should fix the problem because it uses the font-lock-face
> property which is not cleared by font-lock.
>
> If you find the patch works, please just install it for me,

Your patch fixes the problem I described.  I'll add a comment
explaining the need to use font-lock-face and commit it.

Lute.




reply via email to

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