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 14:00:25 -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> 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 1416952896 24318 80.91.229.3 (25 Nov 2014 22:01:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2014 22:01:36 +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 Tue Nov 25 23:01:27 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 1XtOAp-0008GR-0Z for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 23:01:27 +0100 Original-Received: from localhost ([::1]:59680 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtOAo-0003ik-Mk for geb-bug-gnu-emacs@m.gmane.org; Tue, 25 Nov 2014 17:01:26 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtOAd-0003gt-DI for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 17:01:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtOAQ-0007Rd-Qg for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 17:01:15 -0500 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48097) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtOAQ-0007RZ-Nn for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 17:01:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1XtOAQ-00026m-IX for bug-gnu-emacs@gnu.org; Tue, 25 Nov 2014 17:01:02 -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 22:01: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.14169528328055 (code B ref 19170); Tue, 25 Nov 2014 22:01:02 +0000 Original-Received: (at 19170) by debbugs.gnu.org; 25 Nov 2014 22:00:32 +0000 Original-Received: from localhost ([127.0.0.1]:45310 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtO9v-00025q-HD for submit@debbugs.gnu.org; Tue, 25 Nov 2014 17:00:31 -0500 Original-Received: from userp1040.oracle.com ([156.151.31.81]:18875) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XtO9t-00025g-9i for 19170@debbugs.gnu.org; Tue, 25 Nov 2014 17:00:29 -0500 Original-Received: from ucsinet21.oracle.com (ucsinet21.oracle.com [156.151.31.93]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id sAPM0REm012097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 25 Nov 2014 22:00:28 GMT Original-Received: from aserz7021.oracle.com (aserz7021.oracle.com [141.146.126.230]) by ucsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAPM0QtH017896 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Tue, 25 Nov 2014 22:00:27 GMT Original-Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserz7021.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id sAPM0QSL013304; Tue, 25 Nov 2014 22:00:26 GMT In-Reply-To: <87egsr0xjt.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: ucsinet21.oracle.com [156.151.31.93] 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:96576 Archived-At: > > How to choose? Click the mouse in a window, >=20 > This is what `ediff-get-window-by-clicking' does. Yes. > But what to do if the user doesn't use the mouse? See next. > > or choose a window by name using the keyboard - > > those are two possibilities I suggested. >=20 > You mean to choose a window by it's buffer name? > I.e. like `ediff-buffers'? But the problem is that the > uniqueness of buffer names is not guaranteed in this case. See what I wrote at the outset: Choosing a window could take any reasonable form: click mouse-1 in it, choose by its buffer name (with uniquification when multiple windows show the same buffer),... FWIW, I use this in Icicles. Maybe it helps to give an idea what I had in mind wrt window naming. If not, ignore. (defun icicle-make-window-alist (&optional all-p) "Return an alist of entries (WNAME . WINDOW), where WNAME names WINDOW. The name of the buffer in a window is used as its name, unless there is more than one window displaying the same buffer. In that case, WNAME includes a suffix [NUMBER], to make it a unique name. The NUMBER order among window names that differ only by their [NUMBER] is arbitrary. Argument ALL-P determines which frames to use when gathering windows, as follows: * `visible' - include windows from all visible frames. * otherwise non-nil - include windows from all frames (including those that are iconified and invisible). * nil - include only windows from the selected frame." (lexical-let ((win-alist ()) (count 2) wname new-name) (walk-windows (lambda (w) ; FREE here: COUNT, NEW-NAME, WIN-ALIST, WNAME. (setq wname (buffer-name (window-buffer w))) (if (not (assoc wname win-alist)) (push (cons wname w) win-alist) (setq new-name wname) (while (assoc new-name win-alist) (setq new-name (format "%s[%d]" wname count) count (1+ count))) (push (cons new-name w) win-alist)) (setq count 2)) 'no-mini (case all-p (visible 'visible) ((nil) 'this-frame) (otherwise t))) win-alist)) > What do you think about such workflow: select a target window > using normal keybindings or mouse clicks. Then mark the > selected window as the target window using a new prefix > of `compare-windows'. Then switch back to the original window > using standard keybindings, and run `compare-windows'. > It could use the remembered target window. Not sure I understand what you describe, but it sounds like you mean to just somehow select the other window (the one you want, not `other-window'), then move back to the original window, and have the fact that the other window was the previously selected window let it be used as the default second window for the comparison. If so, yes, that's what I was suggesting by comparison with Ediff. With buffers it is enough to select another buffer, to make it become recorded as the previous buffer, so it becomes the default. But that works because `buffer-list' records chronological access. AFAIK, we do not have that (yet) for windows. And yes, we need only record the previously selected window, not a whole access history (at least for this command). This would be for the click-in-another-window approach. But for keyboard use the problem really is, as I see it, that when there are many windows (this is across possibly many frames) the usual way to select one of them, which is to repeat `C-x o', is tedious. That's why I suggested choosing by name in this case. HTH.