From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lute Kamstra Newsgroups: gmane.emacs.devel Subject: Re: Fwd: Re: junk in *grep* buffers Date: Wed, 27 Apr 2005 13:29:34 +0200 Message-ID: <87ll7431b5.fsf@xs4all.nl> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114601550 8256 80.91.229.2 (27 Apr 2005 11:32:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Apr 2005 11:32:30 +0000 (UTC) Cc: rms@gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Apr 27 13:32:26 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQklN-0008V1-Sc for ged-emacs-devel@m.gmane.org; Wed, 27 Apr 2005 13:31:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQkrI-000360-ER for ged-emacs-devel@m.gmane.org; Wed, 27 Apr 2005 07:37:36 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQkqN-0002N2-T2 for emacs-devel@gnu.org; Wed, 27 Apr 2005 07:36:40 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQkqK-0002MB-7F for emacs-devel@gnu.org; Wed, 27 Apr 2005 07:36:39 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQkqK-0001kV-3e for emacs-devel@gnu.org; Wed, 27 Apr 2005 07:36:36 -0400 Original-Received: from [194.109.24.21] (helo=smtp-vbr1.xs4all.nl) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQkna-0007PK-Vj; Wed, 27 Apr 2005 07:33:47 -0400 Original-Received: from pijl (a80-127-67-124.adsl.xs4all.nl [80.127.67.124]) by smtp-vbr1.xs4all.nl (8.12.11/8.12.11) with ESMTP id j3RBTZxr034608; Wed, 27 Apr 2005 13:29:35 +0200 (CEST) (envelope-from Lute.Kamstra@xs4all.nl) Original-Received: from lute by pijl with local (Exim 3.36 #1 (Debian)) id 1DQkjW-0001s5-00; Wed, 27 Apr 2005 13:29:34 +0200 Original-To: Stefan Monnier In-Reply-To: (Stefan Monnier's message of "Tue, 26 Apr 2005 17:24:24 -0400") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) Original-Lines: 46 X-Virus-Scanned: by XS4ALL Virus Scanner X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:36445 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:36445 Stefan Monnier 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.