Subject: bug#12987: Mode switching during isearch isn't user friendly

From: Juri Linkov <[email-masked]>
Date: Sun, 25 Nov 2012 11:38:30 +0200

> This is a UI improvement suggestion, not a bug report.
> Using 24.2, type:
> onto to
> Then do:
> C-a C-s to
> It highlights the first occurrence of "to" as the current match,
> and the second as the next match.
> Then do: M-s w
> It continues to highlight the first occurrence of "to", even though that
> occurrence no longer matches. It should remove the highlight
> immediately. Pressing C-s again will remove the highlight, which is not
> user-friendly; pressing C-s should never cause highlights to be removed.
> This same problem applies to case-sensitivity mode (M-c) too.

A pending search doesn't jump to the next match.  It displays the
text "pending" in the prompt inviting you to type `C-s' or `C-r'
or more togging commands.

A failed search doesn't remove highlighting too.  E.g. when you type
`C-s tofoo' then the first occurrence of "to" is still highlighted.

If you want `M-s w' to jump to the next match, you can create a new
command like `isearch-toggle-word' where the line

  (setq isearch-success t isearch-adjusted t)

is replaced with

  (isearch-search) (isearch-push-state)