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

From: Eli Zaretskii <[email-masked]>
Date: Tue, 11 Feb 2014 18:23:34 +0200

> Date: Tue, 11 Feb 2014 07:23:26 -0800 (PST)
> From: Drew Adams <[email-masked]>
> Cc: [email-masked]
> 
> > > In this case the mismatch highlighting is inaccurate:
> > >
> > > emacs -Q
> > > C-x b *scratch*
> > > C-s ZZZZ
> > >
> > > The entire search string is highlighted as a mismatch, which is
> > > correct.
> > >
> > > M-e M-a e
> > >
> > > So the edited search string is eZZZZ.
> > >
> > > C-s
> > >
> > > The entire search string, `eZZZZ' is highlighted, even though
> > > there are matches for the `e'.
> > 
> > Seems to work for me.  Closing.
> 
> Seems to work for you apparently means little, I'm afraid.
> 
> Still a bug on Windows, at least.  The only difference in the
> recipe now is that you need not use M-a.  The point is that
> after inserting `e' at the front of the search string, `C-s'
> still highlights the whole search string, `eZZZZ', instead of
> highlighting only the mismatch portion, `ZZZZ'.

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.  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.  And that is what I would expect.

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