Subject: Re: bug#47894: 28.0.50; isearch does not work if enable-recursive-minibuffers is on and some input method is set.

From: Juri Linkov <[email-masked]>
Date: Wed, 21 Apr 2021 20:37:07 +0300

> On the contrary, what Zhiwei Chen asked is what the patch does: exit
> isearch when point has moved to another window at the request of the user.

Anyone who wants to exit isearch, needs to do this explicitly,
where the request of the user means typing a key that exits isearch.

>> So rather than forcibly exit isearch, we could select the original window
>> back, in the same vein as isearch-back-into-window in the same hook moves
>> point back to the old window boundaries:
>
> That would be the opposite of what Zhiwei Chen asked (twice), but I won't
> fight for him.

His example used the command isearch-occur.  This command
is exceptional - it doesn't exit intentionally, to be able
to show matches in another window without exiting isearch.

So the right customization for him is

  (advice-add 'isearch-occur :after
              (lambda (&rest _args)
                (isearch-done nil t)
                (isearch-clean-overlays)))