From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#17453: Framework extending window functions for Follow Mode (etc.). Date: Thu, 12 Nov 2015 22:14:22 +0200 Organization: LINKOV.NET Message-ID: <8737wbx9ep.fsf@mail.linkov.net> References: <20151105192905.GA7986@acm.fritz.box> <20151107182420.GA1774@acm.fritz.box> <871tc18oai.fsf@mail.linkov.net> <20151108002955.GC1774@acm.fritz.box> <8737wgou4z.fsf@mail.linkov.net> <20151109154124.GC2284@acm.fritz.box> <87611a8x96.fsf@mail.linkov.net> <20151110110823.GB2626@acm.fritz.box> <876119s7fu.fsf@mail.linkov.net> <20151111161914.GB5669@acm.fritz.box> <87egfwca3b.fsf@mail.linkov.net> <56444C48.5000609@gmx.at> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1447359443 5970 80.91.229.3 (12 Nov 2015 20:17:23 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 12 Nov 2015 20:17:23 +0000 (UTC) Cc: Alan Mackenzie , 17453@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Nov 12 21:17:12 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1ZwyIx-00007y-Oy for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 21:17:12 +0100 Original-Received: from localhost ([::1]:49620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwyIx-00052W-9c for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Nov 2015 15:17:11 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51287) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwyIt-00051r-Oa for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 15:17:08 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZwyIo-0000Ex-Nh for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 15:17:07 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:44402) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZwyIo-0000Et-Jj for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 15:17:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZwyIo-0007oh-14 for bug-gnu-emacs@gnu.org; Thu, 12 Nov 2015 15:17:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 Nov 2015 20:17:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17453 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17453-submit@debbugs.gnu.org id=B17453.144735938730004 (code B ref 17453); Thu, 12 Nov 2015 20:17:01 +0000 Original-Received: (at 17453) by debbugs.gnu.org; 12 Nov 2015 20:16:27 +0000 Original-Received: from localhost ([127.0.0.1]:35110 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwyIE-0007nr-Ef for submit@debbugs.gnu.org; Thu, 12 Nov 2015 15:16:26 -0500 Original-Received: from sub3.mail.dreamhost.com ([69.163.253.7]:39491 helo=homiemail-a76.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZwyHt-0007nQ-O6 for 17453@debbugs.gnu.org; Thu, 12 Nov 2015 15:16:24 -0500 Original-Received: from homiemail-a76.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTP id BFC10458084; Thu, 12 Nov 2015 12:16:03 -0800 (PST) Original-Received: from localhost.linkov.net (m83-191-160-148.cust.tele2.ee [83.191.160.148]) (Authenticated sender: jurta@jurta.org) by homiemail-a76.g.dreamhost.com (Postfix) with ESMTPA id 9BAD7458081; Thu, 12 Nov 2015 12:16:02 -0800 (PST) In-Reply-To: <56444C48.5000609@gmx.at> (martin rudalics's message of "Thu, 12 Nov 2015 09:22:32 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:108680 Archived-At: >> Thanks, I'm looking at your changes, and also Cc'ing Martin in the hope >> that Martin could review your window-related changes as well. > > Glimpsing on the window-related changes I think I have already said > everything in this thread. Usurpating the term "group" in the sense > that all windows belonging to a group have to show the same buffer seems > overly restrictive but I don't want to continue the earlier discussion. I agree that the cleanest way to add a new feature is not to change window primitives, but to add it on the top of existing window primitives by defining a new functional layer with a set of functions having a common name prefix either 'window-group-' or 'windows-' (used by follow.el in some places). Here are existing primitives and two variants of new functions: (window-start &optional WINDOW) (windows-start &optional WINDOW) (window-group-start &optional WINDOW) (set-window-start WINDOW POS &optional NOFORCE) (set-windows-start WINDOW POS &optional NOFORCE) (set-window-group-start WINDOW POS &optional NOFORCE) (move-to-window-line COUNT) (move-to-windows-line COUNT) (move-to-window-group-line COUNT) (pos-visible-in-window-p &optional POS WINDOW PARTIALLY) (pos-visible-in-windows-p &optional POS WINDOW PARTIALLY) (pos-visible-in-window-group-p &optional POS WINDOW PARTIALLY) These new functions could be defined in a new core package with a name like window-group.el or windows.el, or maybe added to the end of window.el, and have no follow-specific code. Then there is no need in a set of functions like window-start-group-function, because one function should be enough for a package like follow.el to declare an active group of windows via follow-all-followers, or packages other than follow.el using window parameters. Then window-group/windows functions should take care about all aspects of handling multiple windows. So e.g. new function follow-window-start will be window-group-start taking only follow-all-followers from follow.el, etc. This means that while adapting other packages to multi-window configurations, instead of adding the 't' arg to core primitives, we need to add 's' (window -> windows) or '-group' to the names of the existing function calls. The key point is not touching core primitives until we'll be able to implement a proper display abstraction for window groups such as proposed a while ago under the name "framelettes". This comment in follow.el also gives a hint in this direction: ;; Almost like the real thing, except when the cursor ends up outside ;; the top or bottom... In our case however, we end up outside the ;; window and hence we are recentered. Should we let `recenter' handle ;; the point position we would never leave the selected window. To do ;; it ourselves we would need to do our own redisplay, which is easier ;; said than done. (Why didn't I do a real display abstraction from ;; the beginning?)