Subject: bug#8429: 24.0.50; regression: `flush-lines' does not flush all it should

From: "Drew Adams" <[email-masked]>
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.  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:;;;[01;31m##[00m[K#autoload
apropos.el:524:;;;[01;31m##[00m[K#autoload
apropos.el:563:;;;[01;31m##[00m[K#autoload
apropos.el:669:;;;[01;31m##[00m[K#autoload
apropos.el:715:;;;[01;31m##[00m[K#autoload
arc-mode.el:634:;;;[01;31m##[00m[K#autoload
array.el:802:;;;[01;31m##[00m[K#autoload
autoarg.el:91:;;;[01;31m##[00m[K#autoload
autoarg.el:113:;;;[01;31m##[00m[K#autoload
autoinsert.el:318:;;;[01;31m##[00m[K#autoload
autoinsert.el:379:;;;[01;31m##[00m[K#autoload
autoinsert.el:398:;;;[01;31m##[00m[K#autoload
autorevert.el:117:;;; What's this?: ;;;[01;31m##[00m[K#autoload
autorevert.el:285:;;;[01;31m##[00m[K#autoload
autorevert.el:306:;;;[01;31m##[00m[K#autoload
autorevert.el:315:;;;[01;31m##[00m[K#autoload
autorevert.el:368:;;;[01;31m##[00m[K#autoload
autorevert.el:377:;;;[01;31m##[00m[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.