Subject: bug#17453: Isearch doesn't work properly with Follow Mode.

From: Eli Zaretskii <[email-masked]>
Date: Mon, 02 Nov 2015 17:46:34 +0200

Lets' take emacs-devel out of this shall we?

> Date: Mon, 2 Nov 2015 12:35:12 +0000
> From: Alan Mackenzie <[email-masked]>
> Cc: Juri Linkov <[email-masked]>, [email-masked],
> 	Stefan Monnier <[email-masked]>,
> 	emacs-devel <[email-masked]>
> 
> > Maybe I missed part of the issue. I thought you wanted Isearch to
> > switch to another window if that window contains the next match
> > (instead of scrolling the current window). For that, you only need
> > pos-visible-in-window-p, you don't need to mess with boundaries.
> 
> What is causing the unwanted scrolling rather than moving to the next
> window, is the form "(sit-for 0)" near the start of
> isearch-lazy-highlight-new-loop.  When point is outside the window, this
> form causes redisplay, which scrolls point back into the window -
> without Follow Mode getting a look in.  In my patch, I replaced this
> with "(sit*-for 0)", where Follow Mode can do its thing before the
> redisplay happens.

If this means that sit*-for does something other than redisplay and
wait, like switch to another window, I'd really suggest to rethink
that.  It is entirely counter-intuitive to have a sit-for family of
functions do anything other than some kind of redisplay and some kind
of waiting.

I think it is a better idea to have Isearch switch to another window
when the next hit is there, via some specialized movement command that
Follow mode could customize.  That'd be something expectable.