GNU bug report logs - #8429
move grep highlight from font-lock to process filter

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: minor; Reported by: "Drew Adams" <drew.adams <at> oracle.com>; dated Tue, 5 Apr 2011 19:08:02 UTC; Maintainer for emacs is bug-gnu-emacs <at> gnu.org.
Changed bug title to 'move grep highlight from font-lock to process filter' from '24.0.50; regression: `flush-lines' does not flush all it should' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 6 Apr 2011 01:29:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 21:29:06 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7HYQ-0000kG-0x
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 21:29:06 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.183]
	helo=ironport2-out.pppoe.ca)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <monnier <at> iro.umontreal.ca>) id 1Q7HYO-0000jk-4c
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 21:29:04 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AvsEAHjBm01FpZU1/2dsb2JhbAClc3iIeblihWwElkY
X-IronPort-AV: E=Sophos;i="4.63,307,1299474000"; d="scan'208";a="103350958"
Received: from 69-165-149-53.dsl.teksavvy.com (HELO pastel.home)
	([69.165.149.53])
	by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA;
	05 Apr 2011 21:28:57 -0400
Received: by pastel.home (Postfix, from userid 20848)
	id 1B69E58C65; Tue,  5 Apr 2011 21:28:57 -0400 (EDT)
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: "Drew Adams" <drew.adams <at> oracle.com>
Subject: Re: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
Message-ID: <jwvei5gw4ly.fsf-monnier+emacs <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
	<D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
	<83mxk4v3jj.fsf <at> gnu.org>
	<1EA42FB8EA9B4526BF3D014AC2BB0CFE <at> us.oracle.com>
Date: Tue, 05 Apr 2011 21:28:57 -0400
In-Reply-To: <1EA42FB8EA9B4526BF3D014AC2BB0CFE <at> us.oracle.com> (Drew Adams's
	message of "Tue, 5 Apr 2011 14:06:58 -0700")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 8429
Cc: 'Eli Zaretskii' <eliz <at> gnu.org>, 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> If I had to guess in ignorance I'd say that it has to do with Emacs 24
> highlighting only a screen at a time, instead of the whole buffer.
> For the part of the buffer that gets highlighted (so the escape chars
> are not apparent) there is no problem.

Sounds like the likely culprit.  And the fix is still the same: move the
grep-highlighting-processing from font-lock to the process filter.


        Stefan




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 21:15:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 17:15:45 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7DbF-0002qd-4y
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 17:15:45 -0400
Received: from rcsinet10.oracle.com ([148.87.113.121])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7DbC-0002qR-RV
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 17:15:43 -0400
Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117])
	by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id
	p35LFZbX011622
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 5 Apr 2011 21:15:36 GMT
Received: from acsmt358.oracle.com (acsmt358.oracle.com [141.146.40.158])
	by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id
	p35LFYh5025924
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 5 Apr 2011 21:15:34 GMT
Received: from abhmt017.oracle.com (abhmt017.oracle.com [141.146.116.26])
	by acsmt358.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p35LFXpH004534; Tue, 5 Apr 2011 16:15:34 -0500
Received: from dradamslap1 (/10.159.34.208)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 05 Apr 2011 14:15:33 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
	<D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
	<83lizov30x.fsf <at> gnu.org>
Subject: RE: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
Date: Tue, 5 Apr 2011 14:15:33 -0700
Message-ID: <B706B7CE766D4776A4C947CAC72C5979 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <83lizov30x.fsf <at> gnu.org>
thread-index: Acvz0sclqj+S6UlISZCVkcK03dO2RwAArlGA
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
X-Source-IP: acsmt358.oracle.com [141.146.40.158]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090203.4D9B8677.0069:SCFSTAT5015188,ss=1,fgs=0
X-Spam-Score: -6.5 (------)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.5 (------)

> > So the problem seems to be lazy highlighting. Unhighlighted 
> > text interferes with
> > search etc. because of the escape chars.
> 
> Yes, it sounds like flush-lines should retry when it fails to find a
> match, after lazy-highlighting the next portion of the buffer.

That doesn't sound like the right approach to me.

For one thing, the problem is not limited to `flush-lines'.  Any action on the
buffer text that gets thrown off by the added chars will be affected.  One of
the reasons to run `grep' in Emacs is to have a buffer of text to operate on.

For another thing, it's not clear that changing `flush-lines' in that way would
be appropriate for other use `flush-lines' contexts.

As I said, we might need to opt for letting the user initiate an editing mode.
Until now, `C-x C-q' was enough for that.  But maybe now more is needed.

But that's only if this bug cannot really be fixed in a way that gives back the
pre-regression behavior.

IOW, things worked well in Emacs 22 and 23; what was gained in losing this
behavior?  My guess is that the answer is performance: highlighting is no doubt
much faster because only what's shown gets highlighted.  That is important
(useful), no doubt about it.

If a tradeoff is needed and no better solution can be found, then I'd suggest a
command to make the buffer editable and completely highlighted.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 21:07:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 17:07:12 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7DSy-0002ds-5n
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 17:07:12 -0400
Received: from rcsinet10.oracle.com ([148.87.113.121])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7DSv-0002df-I2
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 17:07:10 -0400
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227])
	by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id
	p35L71Z8023207
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 5 Apr 2011 21:07:03 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id
	p35L6x8i021281
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 5 Apr 2011 21:06:59 GMT
Received: from abhmt014.oracle.com (abhmt014.oracle.com [141.146.116.23])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p35L6xYk020791; Tue, 5 Apr 2011 16:06:59 -0500
Received: from dradamslap1 (/10.159.34.208)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 05 Apr 2011 14:06:59 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
	<D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
	<83mxk4v3jj.fsf <at> gnu.org>
Subject: RE: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
Date: Tue, 5 Apr 2011 14:06:58 -0700
Message-ID: <1EA42FB8EA9B4526BF3D014AC2BB0CFE <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <83mxk4v3jj.fsf <at> gnu.org>
thread-index: Acvz0ScbBkQ/J+PLQOCnJDo+NpQS4QAACVbw
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
X-Source-IP: acsmt356.oracle.com [141.146.40.156]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090205.4D9B8474.0095:SCFSTAT5015188,ss=1,fgs=0
X-Spam-Score: -6.5 (------)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.5 (------)

> > > Does it work if you copy the entire contents of the Grep buffer to
> > > another buffer?
> >=20
> > No, same problem.
>=20
> Well, as you yourself show, it is not the "same problem".

Same problem as the one I reported: `flush-lines' removes only the first =
few
matching lines.

> (And btw, there's no need to load cygwin-FOO.el to see the problem.
> Just "M-x grep RET "#" *.el" is enough.  It is also repeatable on
> GNU/Linux.)

I was clear that this is on Windows.  And on Windows there is no `grep' =
without
doing something besides emacs -Q.  Hence the recipe for Windows.

> > autorevert.el:368:;;;=1B[01;31m##=1B[00m=1B[K#autoload
> > autorevert.el:377:;;;=1B[01;31m##=1B[00m=1B[K#autoload
> > ...
> >=20
> > As you can see, the problem seems to be that the string=20
> > "###autoload" is not present as such.
>=20
> Exactly!  Customize grep-highlight-matches to nil, and the problem
> goes away.

I hope you are saying that merely in order to lend support for the =
hypothesis
about the cause of the problem.  Doing that is certainly not a solution =
to the
problem.

> > Instead, escape characters are inserted between ## and #.
>=20
> That's Grep in action, when we ask it to highlight matches in its
> output.  It does that by inserting ANSI escape sequences.

Yes, I know.  It also does that in Emacs 22 and 23, but without the bug.

If I had to guess in ignorance I'd say that it has to do with Emacs 24
highlighting only a screen at a time, instead of the whole buffer.  For =
the part
of the buffer that gets highlighted (so the escape chars are not =
apparent) there
is no problem.

> > I hope you will consider it a bug to be fixed.
>=20
> Not me, but hopefully someone else.

You don't consider it a bug to be fixed, but you hope someone else will =
consider
it so?  What's that about?

Turning off highlighting to make the problem go away is not a solution.  =
This is
a regression and represents a real loss of functionality.

If a better solution is not found, we should at least give users =
knowledge of
how to make the buffer amenable to `flush-lines' etc.  Give them a =
command that
does whatever needs to be done.  A single command that makes the buffer =
editable
and fontifies everything would probably be enough, if it is well enough
advertised (e.g. in the `Grep' menu).  Again, that would be an =
acceptable
workaround only IF a real solution cannot be found.

I tried `font-lock-fontify-buffer', thinking that might be enough to do =
the
trick, but it did not.  It is font-locking that removes the escape-char =
markers,
but I guess the laziness of font-locking is still the problem, even with
`font-lock-fontify-buffer'.  The value of (font-lock-value-in-major-mode
font-lock-support-mode) in *grep* is `jit-lock-mode'.

It is common for users to operate on text in the buffer.  This bug makes =
the
*grep* buffer much less useful.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 20:48:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 16:48:17 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7DAf-0002E9-Gg
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:48:17 -0400
Received: from mtaout20.012.net.il ([80.179.55.166])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eliz <at> gnu.org>) id 1Q7DAd-0002Dx-2j
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:48:16 -0400
Received: from conversion-daemon.a-mtaout20.012.net.il by
	a-mtaout20.012.net.il (HyperSendmail v2007.08) id
	<0LJ700C005J6ZC00 <at> a-mtaout20.012.net.il> for
	8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 23:47:39 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([77.126.47.180]) by a-mtaout20.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0LJ700B7Q5RASHC0 <at> a-mtaout20.012.net.il>;
	Tue, 05 Apr 2011 23:47:35 +0300 (IDT)
Date: Tue, 05 Apr 2011 23:47:42 +0300
From: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
In-reply-to: <D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
X-012-Sender: halo1 <at> inter.net.il
To: Drew Adams <drew.adams <at> oracle.com>
Message-id: <83lizov30x.fsf <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
	<D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: Eli Zaretskii <eliz <at> gnu.org>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> From: "Drew Adams" <drew.adams <at> oracle.com>
> Cc: <8429 <at> debbugs.gnu.org>
> Date: Tue, 5 Apr 2011 13:14:57 -0700
> 
> So the problem seems to be lazy highlighting. Unhighlighted text interferes with
> search etc. because of the escape chars.

Yes, it sounds like flush-lines should retry when it fails to find a
match, after lazy-highlighting the next portion of the buffer.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 20:36:39 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 16:36:39 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7CzP-0001x9-9a
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:36:39 -0400
Received: from mtaout22.012.net.il ([80.179.55.172])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eliz <at> gnu.org>) id 1Q7CzN-0001ww-Cn
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:36:38 -0400
Received: from conversion-daemon.a-mtaout22.012.net.il by
	a-mtaout22.012.net.il (HyperSendmail v2007.08) id
	<0LJ700D0055H4L00 <at> a-mtaout22.012.net.il> for
	8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 23:36:27 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([77.126.47.180]) by a-mtaout22.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0LJ700C4058OOR30 <at> a-mtaout22.012.net.il>;
	Tue, 05 Apr 2011 23:36:26 +0300 (IDT)
Date: Tue, 05 Apr 2011 23:36:32 +0300
From: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
In-reply-to: <D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
X-012-Sender: halo1 <at> inter.net.il
To: Drew Adams <drew.adams <at> oracle.com>
Message-id: <83mxk4v3jj.fsf <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
	<D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
X-Spam-Score: -2.1 (--)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: Eli Zaretskii <eliz <at> gnu.org>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -2.1 (--)

> From: "Drew Adams" <drew.adams <at> oracle.com>
> Cc: <8429 <at> debbugs.gnu.org>
> Date: Tue, 5 Apr 2011 13:14:57 -0700
> 
> > Does it work if you copy the entire contents of the Grep buffer to
> > another buffer?
> 
> No, same problem.

Well, as you yourself show, it is not the "same problem".

> But you can try for yourself, given the simple recipe.

I did, that's why I asked.  I wanted to know that we see the same
phenomenon.

(And btw, there's no need to load cygwin-FOO.el to see the problem.
Just "M-x grep RET "#" *.el" is enough.  It is also repeatable on
GNU/Linux.)

> autorevert.el:368:;;;###autoload
> autorevert.el:377:;;;###autoload
> ...
> 
> As you can see, the problem seems to be that the string "###autoload" is not
> present as such.

Exactly!  Customize grep-highlight-matches to nil, and the problem
goes away.

> Instead, escape characters are inserted between ## and #.

That's Grep in action, when we ask it to highlight matches in its
output.  It does that by inserting ANSI escape sequences.

> I hope you will consider it a bug to be fixed.

Not me, but hopefully someone else.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 20:15:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 16:15:10 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7Ceb-0001Um-W8
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:15:10 -0400
Received: from rcsinet10.oracle.com ([148.87.113.121])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7Cea-0001UM-1U
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 16:15:08 -0400
Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117])
	by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id
	p35KExkK015846
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK);
	Tue, 5 Apr 2011 20:15:00 GMT
Received: from acsmt356.oracle.com (acsmt356.oracle.com [141.146.40.156])
	by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id
	p35KEwvg029010
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);
	Tue, 5 Apr 2011 20:14:59 GMT
Received: from abhmt016.oracle.com (abhmt016.oracle.com [141.146.116.25])
	by acsmt356.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p35KEwBa011784; Tue, 5 Apr 2011 15:14:58 -0500
Received: from dradamslap1 (/10.159.34.208)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 05 Apr 2011 13:14:58 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: "'Eli Zaretskii'" <eliz <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
	<83oc4kv5ko.fsf <at> gnu.org>
Subject: RE: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
Date: Tue, 5 Apr 2011 13:14:57 -0700
Message-ID: <D6321545C2204B14BC3ED32B75511113 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
X-Mailer: Microsoft Office Outlook 11
In-Reply-To: <83oc4kv5ko.fsf <at> gnu.org>
thread-index: AcvzywNUqjsdpWlNR96GSdWGercRvQAAgJzw
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
X-Source-IP: acsmt356.oracle.com [141.146.40.156]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090204.4D9B7843.015A:SCFSTAT5015188,ss=1,fgs=0
X-Spam-Score: -6.5 (------)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.5 (------)

> Does it work if you copy the entire contents of the Grep buffer to
> another buffer?

No, same problem.  But you can try for yourself, given the simple =
recipe.

After copying to another buffer and trying flush-lines once, I see this =
(tail
abbreviated):

grep -nH -e "##" *.el */*.el
apropos.el:514:;;;=1B[01;31m##=1B[00m=1B[K#autoload
apropos.el:524:;;;=1B[01;31m##=1B[00m=1B[K#autoload
apropos.el:563:;;;=1B[01;31m##=1B[00m=1B[K#autoload
apropos.el:669:;;;=1B[01;31m##=1B[00m=1B[K#autoload
apropos.el:715:;;;=1B[01;31m##=1B[00m=1B[K#autoload
arc-mode.el:634:;;;=1B[01;31m##=1B[00m=1B[K#autoload
array.el:802:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autoarg.el:91:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autoarg.el:113:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autoinsert.el:318:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autoinsert.el:379:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autoinsert.el:398:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:117:;;; What's this?: ;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:285:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:306:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:315:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:368:;;;=1B[01;31m##=1B[00m=1B[K#autoload
autorevert.el:377:;;;=1B[01;31m##=1B[00m=1B[K#autoload
...

As you can see, the problem seems to be that the string "###autoload" is =
not
present as such. Instead, escape characters are inserted between ## and =
#.
Presumably the first few lines were not like that, so they did get =
flushed.

When I yanked the buffer text copied from *grep* into the new buffer =
(foo), the
part of buffer *grep* that had been fontified (or whatever processing is =
done to
visually replace the escape chars with highlighted text) appeared =
fontified in
`foo', and thus those lines did have "###autoload" present, so they got =
flushed.
The remaining lines (many, many), which were not highlighted, did not =
get
flushed.

So the problem seems to be lazy highlighting. Unhighlighted text =
interferes with
search etc. because of the escape chars.

I often flush out comment lines etc. from *grep*.  This is a real step =
backward,
IMO. I hope you will consider it a bug to be fixed.





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at 8429 <at> debbugs.gnu.org:


Received: (at 8429) by debbugs.gnu.org; 5 Apr 2011 19:52:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 15:52:43 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7CIt-00010g-LC
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:52:43 -0400
Received: from mtaout23.012.net.il ([80.179.55.175])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <eliz <at> gnu.org>) id 1Q7CIq-00010P-0x
	for 8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:52:41 -0400
Received: from conversion-daemon.a-mtaout23.012.net.il by
	a-mtaout23.012.net.il (HyperSendmail v2007.08) id
	<0LJ700C003014L00 <at> a-mtaout23.012.net.il> for
	8429 <at> debbugs.gnu.org; Tue, 05 Apr 2011 22:52:33 +0300 (IDT)
Received: from HOME-C4E4A596F7 ([77.126.47.180]) by a-mtaout23.012.net.il
	(HyperSendmail v2007.08) with ESMTPA id
	<0LJ700BVL37JUU30 <at> a-mtaout23.012.net.il>;
	Tue, 05 Apr 2011 22:52:32 +0300 (IDT)
Date: Tue, 05 Apr 2011 22:52:39 +0300
From: Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#8429: 24.0.50;
	regression: `flush-lines' does not flush all it should
In-reply-to: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
X-012-Sender: halo1 <at> inter.net.il
To: Drew Adams <drew.adams <at> oracle.com>
Message-id: <83oc4kv5ko.fsf <at> gnu.org>
References: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
X-Spam-Score: -1.8 (-)
X-Debbugs-Envelope-To: 8429
Cc: 8429 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
Reply-To: Eli Zaretskii <eliz <at> gnu.org>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -1.8 (-)

> From: "Drew Adams" <drew.adams <at> oracle.com>
> Date: Tue, 5 Apr 2011 12:01:35 -0700
> Cc: 
> 
> emacs -Q
>  
> Load libraries cygwin-mount.el, setup-cygwin.el, to be able to use grep
> on Windows.  The libraries are here:
> http://www.emacswiki.org/emacs/ElispArea
>  
> cd to the Emacs Lisp source directory.
>  
> M-x grep RET grep -nH -e "#" *.el */*.el RET
>  
> The grep output shows all matches for `#'.
>  
> C-x C-q to make the grep buffer writable.
>  
> M-x flush-lines RET ###autoload RET
>  
> Only the first few lines containing `###autoload' are flushed.
> Repeating `flush-lines' flushes a few more.  But all should be flushed
> (assuming point is at bob).  Same thing if you do `C-x h' before M-x
> flush-lines.

Does it work if you copy the entire contents of the Grep buffer to
another buffer?




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Apr 2011 19:07:45 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Apr 05 15:07:45 2011
Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Q7BbM-0008St-Lk
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:07:45 -0400
Received: from eggs.gnu.org ([140.186.70.92])
	by debbugs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7BbL-0008Sg-Ds
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:07:44 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7BbC-0006zG-IN
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:07:38 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED,
	T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1
Received: from lists.gnu.org ([199.232.76.165]:60807)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7BbC-0006x5-GD
	for submit <at> debbugs.gnu.org; Tue, 05 Apr 2011 15:07:34 -0400
Received: from [140.186.70.92] (port=48541 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1Q7BXh-0002Sx-L6
	for bug-gnu-emacs <at> gnu.org; Tue, 05 Apr 2011 15:04:42 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7BVW-00053K-Gx
	for bug-gnu-emacs <at> gnu.org; Tue, 05 Apr 2011 15:01:43 -0400
Received: from rcsinet10.oracle.com ([148.87.113.121]:20755)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <drew.adams <at> oracle.com>) id 1Q7BVW-00052v-BE
	for bug-gnu-emacs <at> gnu.org; Tue, 05 Apr 2011 15:01:42 -0400
Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227])
	by rcsinet10.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id
	p35J1b7O022829
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK)
	for <bug-gnu-emacs <at> gnu.org>; Tue, 5 Apr 2011 19:01:38 GMT
Received: from acsmt357.oracle.com (acsmt357.oracle.com [141.146.40.157])
	by acsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id
	p35J1a4F032714
	(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO)
	for <bug-gnu-emacs <at> gnu.org>; Tue, 5 Apr 2011 19:01:37 GMT
Received: from abhmt003.oracle.com (abhmt003.oracle.com [141.146.116.12])
	by acsmt357.oracle.com (8.12.11.20060308/8.12.11) with ESMTP id
	p35J1aZH017232
	for <bug-gnu-emacs <at> gnu.org>; Tue, 5 Apr 2011 14:01:36 -0500
Received: from dradamslap1 (/10.159.34.208)
	by default (Oracle Beehive Gateway v4.0)
	with ESMTP ; Tue, 05 Apr 2011 12:01:35 -0700
From: "Drew Adams" <drew.adams <at> oracle.com>
To: <bug-gnu-emacs <at> gnu.org>
Subject: 24.0.50; regression: `flush-lines' does not flush all it should
Date: Tue, 5 Apr 2011 12:01:35 -0700
Message-ID: <31A5E2DEB9B24F82A8AD85713507FE10 <at> us.oracle.com>
MIME-Version: 1.0
Content-Type: text/plain;
	charset="us-ascii"
Content-Transfer-Encoding: 7bit
X-Mailer: Microsoft Office Outlook 11
thread-index: Acvzw+JGYaAfqcEaQdeuNdy7MYj9OA==
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994
X-Source-IP: acsmt357.oracle.com [141.146.40.157]
X-Auth-Type: Internal IP
X-CT-RefId: str=0001.0A090208.4D9B6711.003F:SCFSTAT5015188,ss=1,fgs=0
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2)
X-Received-From: 199.232.76.165
X-Spam-Score: -6.5 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.11
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/pipermail/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.5 (------)

emacs -Q
 
Load libraries cygwin-mount.el, setup-cygwin.el, to be able to use grep
on Windows.  The libraries are here:
http://www.emacswiki.org/emacs/ElispArea
 
cd to the Emacs Lisp source directory.
 
M-x grep RET grep -nH -e "#" *.el */*.el RET
 
The grep output shows all matches for `#'.
 
C-x C-q to make the grep buffer writable.
 
M-x flush-lines RET ###autoload RET
 
Only the first few lines containing `###autoload' are flushed.
Repeating `flush-lines' flushes a few more.  But all should be flushed
(assuming point is at bob).  Same thing if you do `C-x h' before M-x
flush-lines.
 
This is a regression wrt Emacs 23.3 and older releases.  But the
`flush-lines' code itself seems not to have changed since 23.3.
 

In GNU Emacs 24.0.50.1 (i386-mingw-nt5.1.2600)
 of 2011-04-04 on 3249CTO
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (4.5) --no-opt --cflags
-Ic:/imagesupport/include'
 





Acknowledgement sent to "Drew Adams" <drew.adams <at> oracle.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. Full text available.
Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#8429; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Fri, 7 Oct 2011 07:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.