From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.bugs Subject: bug#19170: 25.0.50; enhancement request: `compare-windows' use across frames Date: Tue, 25 Nov 2014 15:40:19 -0800 (PST) Message-ID: References: <32848088-e8db-46dc-b9c7-f53bc46bb4e1@default> <87egss9r7v.fsf@mail.linkov.net> <2f6cb7a6-e050-4909-9b54-d651523bb5d5@default> <87egss86a8.fsf@mail.linkov.net> <87egsr0xjt.fsf@mail.linkov.net> <87egsqzy74.fsf@mail.linkov.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1416958892 22225 80.91.229.3 (25 Nov 2014 23:41:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2014 23:41:32 +0000 (UTC) Cc: 19170@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Nov 26 00:41:24 2014 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 1XtPjY-0002J6-E8 for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Nov 2014 00:41:24 +0100 Original-Received: from localhost ([::1]:59914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtPjX-00014p-OZ for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 18:41:23 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54552) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtPjM-00014h-Gn for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 18:41:21 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtPjD-0001kJ-Ly for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 18:41:12 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48124) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtPjD-0001k9-IJ for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 18:41:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XtPjC-0004kv-Rs for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 18:41:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 25 Nov 2014 23:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 19170 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 19170-submit@debbugs.gnu.org id=B19170.141695883218235 (code B ref 19170); Tue, 25 Nov 2014 23:41:02 +0000 Original-Received: (at 19170) by debbugs.gnu.org; 25 Nov 2014 23:40:32 +0000 Original-Received: from localhost ([127.0.0.1]:45337 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtPih-0004k2-2q for submit@debbugs.gnu.org; Tue, 25 Nov 2014 18:40:31 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:21459) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtPib-0004jn-9y for 19170@debbugs.gnu.org; Tue, 25 Nov 2014 18:40:26 -0500 Original-Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sAPNeNiS011698 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Nov 2014 23:40:24 GMT Original-Received: from userz7022.oracle.com (userz7022.oracle.com [156.151.31.86]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAPNeKjx011382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 25 Nov 2014 23:40:22 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by userz7022.oracle.com (8.14.5+Sun/8.14.4) with ESMTP id sAPNeJ5c027644; Tue, 25 Nov 2014 23:40:20 GMT In-Reply-To: <87egsqzy74.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.8.2 (807160) [OL 12.0.6691.5000 (x86)] X-Source-IP: acsinet21.oracle.com [141.146.126.237] 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: 140.186.70.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:96578 Archived-At: > Below is the smallest patch that implements this feature. > It refactors the next-window choosing logic into a separate > function that you can redefine using define-advice if you want > to define own logic. By default, it provides a special command > `compare-windows-set-next-window' that you can bind to an own key > and use to define the next window that `compare-windows' will use, > then move back to the original window and execute `compare-windows' > normally (with or without its current argument to ignore > whitespace). Thanks for working on this, Juri. I don't have the time to check it out well now, but a quick try says please go for it. Some things that I think are missing, or that might be helpful: 1. Maybe echo some indication of which two windows are compared (?). 2. Have a command that goes back and forth between the selected window and the previously selected one. E.g., make the window-selecting command swap the values, so that the previous window is always the other one. #2 will let you easily go between the two windows being compared, but you will also be able to use it more generally. IOW, whenever another window is selected, update the previous-window value. I guess maybe I'm specifying a different approach, where instead of using `compare-windows-get-next-window' we would use just (a) the selected window and (b) the previously selected window. (That would be the default behavior.) And every command (should it be limited to interactive only?) that selects a different window would automatically update the saved value of the last-used window (a variable). In sum, instead of having `compare-windows' be the one that gets the "next window" (per `compare-windows-get-next-window'), and instead of having command `compare-windows-set-next-window', `compare-window' would just use the last two windows selected (by default). The real change would be in having the "last window selected" be kept up to date automatically. If that were done always, and not just when you select a window interactively (dunno whether that is the right thing to do) then presumably it could be, for example, `select-window' that does it (updates a variable `last-window-selected'). I'm thinking that having that last-selected window recorded always might be a good thing, useful for more than just `compare-windows'. (And perhaps (?) the NORECORD arg of `select-window' should control updating of `last-window-selected' also. Dunno.) What do you think? Does this make sense? If not, please go with what you have; I'm sure it's an improvement on what is there now. Thx.