Subject: bug#8679: 24.0.50; wrong isearch highlighting for mismatch

From: Drew Adams <[email-masked]>
Date: Tue, 11 Feb 2014 08:58:12 -0800 (PST)

> Why is that a bug?  What do you get with this simplified recipe?
> 
>   emacs -Q
>   C-s eZZZZ
> 
> When you type 'e', all the 'e's in the buffer are highlighted, but
> the 'e' in the echo area is highlighted in pink.

It depends where you start the search.  If you start with point
at eob then what you say is true.

If you start the search at bob then the `e' is not pink when you
just type `e'.  When you then type `ZZZZ', so your search string is
now `eZZZZ', the buffer highlighting disappears (there are no
matches).

The mismatched portion of your search string, which is the `ZZZZ'
portion, is highlighted pink, to show that it is a mismatch.
This is the correct (intended) behavior.

> As soon as you type the first 'Z', the highlight in the buffer goes
> away, and the whole "eZ" in the echo area is colored in pink.

See above.

> And that is what I would expect.

It might be all we can reasonably expect; I don't know.  Probably
Juri can answer that.  And yes, in that case this is probably
also the answer to the bug fix request: it might not be easy to
fix.

But the intended behavior of the pink highlighting is to highlight
the mismatch portion of the search string.  What this means is that
there is a bug - the intention is not to highlight also the matched
portion.  It may not be a bug that we can fix, but it is a bug.

> What you seem to expect happens when the search wraps around, but no
> such wrap-around happens in your recipe.