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: Sat, 31 Oct 2015 23:25:38 +0000 Message-ID: <20151031232538.GC1853@acm.fritz.box> References: <20140509224458.GA4205@acm.acm> <20151029232302.GB3812@acm.fritz.box> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1446333860 31507 80.91.229.3 (31 Oct 2015 23:24:20 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 31 Oct 2015 23:24:20 +0000 (UTC) To: Stefan Monnier , 17453@debbugs.gnu.org, emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Nov 01 00:24:12 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 1ZsfVL-0007lA-QT for ged-emacs-devel@m.gmane.org; Sun, 01 Nov 2015 00:24:11 +0100 Original-Received: from localhost ([::1]:57319 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsfVL-0002gN-4W for ged-emacs-devel@m.gmane.org; Sat, 31 Oct 2015 19:24:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:55046) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsfV7-0002gD-2a for emacs-devel@gnu.org; Sat, 31 Oct 2015 19:23:57 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZsfV3-0001zH-Vh for emacs-devel@gnu.org; Sat, 31 Oct 2015 19:23:57 -0400 Original-Received: from mail.muc.de ([193.149.48.3]:56240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZsfV3-0001zC-Je for emacs-devel@gnu.org; Sat, 31 Oct 2015 19:23:53 -0400 Original-Received: (qmail 92491 invoked by uid 3782); 31 Oct 2015 23:23:51 -0000 Original-Received: from acm.muc.de (p579E9C22.dip0.t-ipconnect.de [87.158.156.34]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sun, 01 Nov 2015 00:23:50 +0100 Original-Received: (qmail 26396 invoked by uid 1000); 31 Oct 2015 23:25:38 -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:193039 Archived-At: Hello, John. On Sat, Oct 31, 2015 at 03:35:22PM -0700, John Wiegley wrote: > >>>>> Alan Mackenzie writes: > > 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. > What is the reason for having separate functions such as window*-start, > instead of just taking the car of a list of windows? I may be missing some > context here, but this sounds like special-casing general behavior, and I'm > wondering why it's necessary... The prime use case is in isearch. At the moment isearch doesn't work well when Follow Mode is active (try it!). My first attempt at amending isearch for this involved manipulating Follow Mode's list of windows directly inside isearch.el. The result was too close a coupling between isearch and Follow Mode, and was also rather ragged. Stefan rejected this patch, asking for a more abstract solution. What I am proposing now is a solution where any library which needs to manipulate things like window positions will be trivially upgradable to working with Follow Mode, merely by replacing `window-start' by `window*-start', etc. The fact that the "group" of windows is represented by a list is an implementation detail to be encapsulated within follow.el. In the (fairly distant) future, this might perhaps be superseded by code in redisplay. Perhaps. > John -- Alan Mackenzie (Nuremberg, Germany).