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

From: Alan Mackenzie <[email-masked]>
Date: Sat, 31 Oct 2015 23:32:25 +0000

Hello, Artur

On Sat, Oct 31, 2015 at 11:13:34PM +0000, Artur Malabarba wrote:
> On 29 Oct 2015 11:23 pm, "Alan Mackenzie" <[email-masked]> wrote:

> > Hello, Stefan, hello, Emacs.

> > Resuming a conversation from a year and a half ago, in it I had proposed
> > a patch which made isearch work properly in a Follow Mode set of
> > windows.  In the end, you rejected my patch (in effect), because...

> > On Fri, May 09, 2014 at 10:40:07PM -0400, Stefan Monnier wrote:

> > > I must say I really dislike this hard-coding of follow-mode support in
> > > isearch.el.  Isearch should not know so much about follow-mode and
> > > follow-mode should not know so much about Isearch either.

> > > IOW we should try harder to come up with more general hooks.

> What if isearch just took into account all windows displaying
> current-buffer, instead of just the selected one?
> This wouldn’t involve anything specific to follow mode, and I believe it
> would solve the issue, no?

I don't think so, really.  What exactly does "took into account" mean?
With Follow Mode active, on a forward search you explicitly want point to
move into the next window when the search target is visible there.  When
FM is not active, you most definitely don't want this to happen.

I have working code which make isearch and FM work together nicely.  I
think it's a sufficiently "nice" implementation to commit.

-- 
Alan Mackenzie (Nuremberg, Germany).