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: The future of Follow Mode - a proposal. Date: Sat, 20 Feb 2016 12:44:15 +0000 Message-ID: <20160220124415.GA1758@acm.fritz.box> References: <20160218195630.GA2697@acm.fritz.box> <837fi1u5qt.fsf@gnu.org> <20160219142522.GA3193@acm.fritz.box> <83povsr8cc.fsf@gnu.org> <20160219181834.GC3193@acm.fritz.box> <83io1kr12k.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1455972141 24365 80.91.229.3 (20 Feb 2016 12:42:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Feb 2016 12:42:21 +0000 (UTC) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Feb 20 13:42:12 2016 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 1aX6rS-0000Bc-WF for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 13:42:11 +0100 Original-Received: from localhost ([::1]:60575 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX6rS-0006Tz-C3 for ged-emacs-devel@m.gmane.org; Sat, 20 Feb 2016 07:42:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38462) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX6rD-0006BX-6E for emacs-devel@gnu.org; Sat, 20 Feb 2016 07:41:56 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aX6rA-00081c-09 for emacs-devel@gnu.org; Sat, 20 Feb 2016 07:41:55 -0500 Original-Received: from mail.muc.de ([193.149.48.3]:17120) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aX6r9-00081N-MN for emacs-devel@gnu.org; Sat, 20 Feb 2016 07:41:51 -0500 Original-Received: (qmail 94229 invoked by uid 3782); 20 Feb 2016 12:41:50 -0000 Original-Received: from acm.muc.de (p548A46B3.dip0.t-ipconnect.de [84.138.70.179]) by colin.muc.de (tmda-ofmipd) with ESMTP; Sat, 20 Feb 2016 13:41:49 +0100 Original-Received: (qmail 3428 invoked by uid 1000); 20 Feb 2016 12:44:15 -0000 Content-Disposition: inline In-Reply-To: <83io1kr12k.fsf@gnu.org> User-Agent: Mutt/1.5.24 (2015-08-30) 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:200304 Archived-At: Hello, Eli. On Fri, Feb 19, 2016 at 08:45:39PM +0200, Eli Zaretskii wrote: > > Date: Fri, 19 Feb 2016 18:18:34 +0000 > > Cc: emacs-devel@gnu.org > > From: Alan Mackenzie > > > I already explained this above: "the fact that the current display > > > engine doesn't support windows of unequal width". If you want to lift > > > this limitation, the move_it_* family of functions, which simulate > > > redisplay, and are the workhorse of every decision Emacs makes that > > > concerns layout, cannot switch windows in their inner loops. > > I envisage reinitialising the iterator structure as necessary when > > passing bewteen windows. The change in width would be handled at a > > relatively high level. Or, maybe not, se below. > > The window start position is known, the window end position could be > > calculated as we progress. > The functions we talk about currently don't know what they are invoked > for. Your envisioned changes imply that they should behave > differently depending on whether the results will be used for layout > of the current window or the next/previous window in a group. That's > part of the changes I had in mind. They are not trivial. But without > them, what you want to do will not work reliably. How about adding an extra boolean parameter to the move_it_* functions, perhaps called `physical', which when set would mean the function would have to adjust its iterator when crossing a window boundary, when not set would work the same way as it currently does? `vertical-motion' would also need this extra &optional parameter, possibly a few other defuns, too. There are around 150 calls to move_it_*. I'm guessing that most of these would set `physical' to false, perhaps more of the ones in window.c would use true. > > As an example, `compute_window_start_on_continuation_line' would have to > > use the dimensions of the previous window to determine the window-start. > > Jiggling the various windows around after text changes or scrolling is > > going to be the hard part of the coding. > Yes, and the result will be non-trivial changes in the overall logic, > because redisplaying a window will no longer be independent of other > windows. Yes. This is what is currently implemented in Follow Mode. > It's all doable, of course, but I suggest taking a good look at the > use cases for each of these functions, before you design the way they > should work to support windows of unequal width. -- Alan Mackenzie (Nuremberg, Germany).