From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#70949: display-buffer-choose-some-window Date: Sun, 02 Jun 2024 09:39:32 +0300 Organization: LINKOV.NET Message-ID: <8634pvrgpn.fsf@mail.linkov.net> References: <86jzjwqqmd.fsf@mail.linkov.net> <86ed9xvz3o.fsf@mail.linkov.net> <73251208-1e4c-4231-ae58-faf82363f241@gmx.at> <86jzjoo23l.fsf@mail.linkov.net> <9e29cbbc-65ee-4dd8-8a41-539946e19a7c@gmx.at> <86cypfm6s7.fsf@mail.linkov.net> <86o78xm9y5.fsf@mail.linkov.net> <78dfee56-80b4-4ba7-a012-df31abd21743@gmx.at> <86sey8jv66.fsf@mail.linkov.net> <86zfsfqgtl.fsf@mail.linkov.net> <86plt7dyvu.fsf@mail.linkov.net> <963412d9-85b9-4afe-a29f-52981f24aa5b@gmx.at> <86zfsaaqm1.fsf@mail.linkov.net> <431cc3a7-141e-414f-8650-72771609c407@gmx.at> <86ed9jhkox.fsf@mail.linkov.net> <86frty34km.fsf@mail.linkov.net> <7feb9b0b-8186-499f-8477-2d4f51cec13d@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) Cc: 70949@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jun 02 08:52:25 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sDf4r-000A9z-2V for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Jun 2024 08:52:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sDf4J-0008SM-Q1; Sun, 02 Jun 2024 02:51:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sDf4I-0008Rz-7o for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 02:51:50 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sDf4H-0004Ny-VV for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 02:51:49 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sDf4U-0007wz-0y for bug-gnu-emacs@gnu.org; Sun, 02 Jun 2024 02:52:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Jun 2024 06:52:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 70949 X-GNU-PR-Package: emacs Original-Received: via spool by 70949-submit@debbugs.gnu.org id=B70949.171731108130505 (code B ref 70949); Sun, 02 Jun 2024 06:52:01 +0000 Original-Received: (at 70949) by debbugs.gnu.org; 2 Jun 2024 06:51:21 +0000 Original-Received: from localhost ([127.0.0.1]:57718 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDf3p-0007vx-8R for submit@debbugs.gnu.org; Sun, 02 Jun 2024 02:51:21 -0400 Original-Received: from relay1-d.mail.gandi.net ([217.70.183.193]:41219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sDf3n-0007vW-CZ for 70949@debbugs.gnu.org; Sun, 02 Jun 2024 02:51:20 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 8CA95240002; Sun, 2 Jun 2024 06:50:39 +0000 (UTC) In-Reply-To: <7feb9b0b-8186-499f-8477-2d4f51cec13d@gmx.at> (martin rudalics's message of "Fri, 31 May 2024 11:45:44 +0200") X-GND-Sasl: juri@linkov.net X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286368 Archived-At: >> Not a variable, but a window parameter. A buffer-local variable >> can't be used because for example 'vc-diff-internal' uses such >> call sequence: >> >> (set-buffer buffer) >> (pop-to-buffer (current-buffer)) >> >> so 'display-buffer' is called from 'pop-to-buffer' in the wrong buffer. > > So what we want to do here is to make 'vc-diff' work in the context of > 'vc-dir'. There you have a set of "interesting" files you want to > compare with their base versions. 'vc-diff' calls 'vc-deduce-fileset' > to find the set of files to compare. If that function returns a single > file or a single-file list, we continue as usual. But if that function > returns a list of files, 'vc-diff' knows that it is in or enters a mode > where it should use one and the same window to show a sequence of diffs. But display-buffer displays buffers, not files. > In that latter case, 'vc-diff' could pass an extra optional argument to > 'vc-diff-internal', telling it that it has to call 'pop-to-buffer' with > a 'display-buffer-in-previous-window' action and a 'previous-window' > alist entry whose value is 'vc-diff'. That's all 'vc-diff' can do. This doesn't look like a nice design to require changing the signatures of vc functions. > 'display-buffer-in-previous-window' could now try to find a window whose > 'previous-window' parameter is (or includes the value) 'vc-diff'. If it > finds such a window, it displays the diff there. Otherwise, it has to > display the diff in the usual manner - just as if the 'previous-window' > entry didn't exist. In either case 'display-buffer' would set (or add) > a '(previous-window . vc-diff) parameter for the window used. > > 'quit-window' would eventually remove that 'previous-window' parameter > or entry provided the buffer shown in the window is a vc-diff buffer. > > Note: I don't know how 'vc-deduce-fileset' gets the next file in a set > of files to diff. I simply assume that it does TRT here. I think such design looks overly complicated. I hoped for something much simpler by adding just a few lines to window.el.