From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#70949: display-buffer-choose-some-window Date: Fri, 31 May 2024 11:45:44 +0200 Message-ID: <7feb9b0b-8186-499f-8477-2d4f51cec13d@gmx.at> References: <86jzjwqqmd.fsf@mail.linkov.net> <867cft0xt2.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> Reply-To: martin rudalics Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1796"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 70949@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri May 31 11:47:10 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 1sCyqr-0000GJ-T7 for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 31 May 2024 11:47:10 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCyqe-0003ne-EZ; Fri, 31 May 2024 05:46:56 -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 1sCyqZ-0003lS-1m for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 05:46:51 -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 1sCyqY-00035O-Ou for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 05:46:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCyqj-00043p-Mh for bug-gnu-emacs@gnu.org; Fri, 31 May 2024 05:47:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 31 May 2024 09:47: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.171714876715525 (code B ref 70949); Fri, 31 May 2024 09:47:01 +0000 Original-Received: (at 70949) by debbugs.gnu.org; 31 May 2024 09:46:07 +0000 Original-Received: from localhost ([127.0.0.1]:53248 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCypq-00042L-Kk for submit@debbugs.gnu.org; Fri, 31 May 2024 05:46:06 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:53193) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCypn-00041q-PZ for 70949@debbugs.gnu.org; Fri, 31 May 2024 05:46:04 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1717148745; x=1717753545; i=rudalics@gmx.at; bh=dPa7/MNeuwSrOu6+ZJeDUGioo0mkl47A1HkWkukTC6I=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=S0IEX+4zAYn01GMsvcm90keva4OQZRSCFbNeLhQWt0pkaFDHpmXkSU315FGTGyOw O7G3W721IrQHuIrMRGgxv2yiF3RSCaHc1YIg6kS69Q1CaYRPfHJ9nC6GYW+MJnJD1 MV8D108ukd662Dh7ghiPvos1GwpbNONM9wRY1HAARHscUEoWdFE+ix/mNT99/mhkl Kw8bdwdSErIcO91o6B7H/3bTqkc3ZnrZgbfs4DZhy/OPDHgq3UPzJeA3zq3WIBH3P a/fhASdNJXkI07EObeb700fdCStY4LKBPh83utjPCYYMKyR8fi6doxyQkh8lYhLtn zIPpIKE9YvkHLKoskg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.142]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBDnI-1sLFln2up4-00Chb4; Fri, 31 May 2024 11:45:45 +0200 Content-Language: en-US In-Reply-To: <86frty34km.fsf@mail.linkov.net> X-Provags-ID: V03:K1:YvsvafGtFE2KCJl0wNyZwNRv3Q6tHyypTsVI7Q3246Nz7Fq2qZl uYaNy/1pb11Umu8XP9SHPXHPBelLtBJRFOYtWbDsDgmc0rvCdyN7a5Lt0JP+fAzuoauLmQO zvgRMAsS8PILUZV5olIB/0Ooclb8ehgZlJ9ogyYDCThqj/kF+FsTAfZQbc5YWxB3ZHGZhYd 4IhBSsVvXrHJ1incpY7VA== UI-OutboundReport: notjunk:1;M01:P0:T589vrt9fIs=;z/JwSSQekSSjcPWemO20hoHCxuo r2aVa0MuL1rTYd+tAOaTSCujFijWzP6e6sIwzJY8Y0V3y3PFfdAHKYeXiMPPCz41DL8f3YgyA poRNluL1T9eXuEpRm7ynSwcXOTQofjjD2FFOuNOiC3rASDdHLDt3EWOZ0fwOI6/XW9GGpTOXO 0QQ14Xkv/69E/oF0C4v96+xHrdRFoE20Lj3qhzmtp+nR+QP9RJdq94pljZVqPOJUpjTuTeMyY 1eqIyasdGdq30hukiZIlA+CoKR9gIy2/okB1JHwjswRcndebMX3VY+7X3Ci20teledLWYZCHd ATuxY1bkBwpii2x0+HHuG8Z5eu1rRHHIJ1bzYucIiyqbgAE3KMd/DxBDNj8c0Ly57j4QjkXEb RPPjqdatEFPX9frNMygS9yq5En0Wzt1+omn/atIYmTXLln7IaCYK3Mo4Vcery2WR6cG3I2m9T WQpejhtdqR2IVWaxj5Ly4dzJ0P2glt4lwifOvJdMNM2FvoeW53O14uuN9fV5uH3Zhc4+3e/Cp nmvrXHYtaFEjoml1aqS+5BAT55e+cvsHesIpFnL5AQpRQczaHFxYEtTwIBjdbIhNJPe8mFaiX ikW4Hs0mHIwHy8YGIO+a0BULU+zWXpQt3z5BlsKptEzMH/n4hBvc8ZeoA9WqNawB40fUxRjgN jKGCd0B4uONazQhnzMWi/CEKkuB0fVyXIKMLu0Mx2LDj6i+Lzd3yAjnobVDqMfXUyW3lAuiV3 D7mjxPiCz8kyPv5RSoM/hFUvDqTrbU58kAE1xbHarArHKpYcLWZzdYo7qKJh+7zMU5Xl1f4R 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:286268 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. 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. '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. martin