From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: bug#17453: Isearch doesn't work properly with Follow Mode. Date: Thu, 29 Oct 2015 23:23:02 +0000 Message-ID: <20151029232302.GB3812@acm.fritz.box> References: <20140509224458.GA4205@acm.acm> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1446160900 11015 80.91.229.3 (29 Oct 2015 23:21:40 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 29 Oct 2015 23:21:40 +0000 (UTC) Cc: 17453@debbugs.gnu.org, emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Oct 30 00:21:31 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZrwVd-0007CF-Li for ged-emacs-devel@m.gmane.org; Fri, 30 Oct 2015 00:21:29 +0100 Original-Received: from localhost ([::1]:47518 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrwVc-0002ct-Ec for ged-emacs-devel@m.gmane.org; Thu, 29 Oct 2015 19:21:28 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35441) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrwVZ-0002co-6S for emacs-devel@gnu.org; Thu, 29 Oct 2015 19:21:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZrwVU-0003Bc-7t for emacs-devel@gnu.org; Thu, 29 Oct 2015 19:21:25 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:10885) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZrwVT-0003B2-RR for emacs-devel@gnu.org; Thu, 29 Oct 2015 19:21:20 -0400 Original-Received: (qmail 24807 invoked by uid 3782); 29 Oct 2015 23:21:16 -0000 Original-Received: from acm.muc.de (p548A58AB.dip0.t-ipconnect.de [84.138.88.171]) by colin.muc.de (tmda-ofmipd) with ESMTP; Fri, 30 Oct 2015 00:21:16 +0100 Original-Received: (qmail 12481 invoked by uid 1000); 29 Oct 2015 23:23:02 -0000 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: FreeBSD 9.x X-Received-From: 193.149.48.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192932 Archived-At: 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. That irritated me at the time, but you were right - putting Follow Mode support directly into isearch would not have been a good idea. I've recently started working on the bug again, and although it's not your job anymore, I'd still appreciate you giving me some feedback on my new approach. What I propose is that several functions which operate on windows have extended versions which operate on @dfn{groups of windows}, this meaning (for the moment) Follow Mode groups of windows. These new functions are flexible enough to work with methods other than Follow Mode of grouping windows, should such ever be implemented. The new functions are window*-start, window*-end, set-window*-start, recenter*, pos-visible-in-window*-p, move-to-window*-line, and sit*-for. window*-start returns the window-start of the _first_ window in the group, window*-end returns the window-end of the _last_ window in the group, and so on, all these functions doing the Right Thing for a group of windows. sit*-for exists, because Follow Mode needs a chance to resynchronise its windows before redisplay happens. If Follow Mode is not enabled, all the above functions do the Right Thing on the single window. In addition, there is a function window*-windows, which returns an ordered list of the windows involved (or a list of the single window when F.M. is not active). I have a trial implementation of the above, and a trial adaptation of isearch.el which uses it. It works. What do you think? > Stefan -- Alan Mackenzie (Nuremberg, Germany).