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: Fri, 07 Jun 2024 19:45:33 +0300 Organization: LINKOV.NET Message-ID: <86v82k4s7m.fsf@mail.linkov.net> References: <86jzjwqqmd.fsf@mail.linkov.net> <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> <8634pvrgpn.fsf@mail.linkov.net> <79afb441-6e62-4a0d-affa-27b7b494e406@gmx.at> <86wmn4ln3c.fsf@mail.linkov.net> <86d70100-efeb-4326-aece-3ec78e023a4f@gmx.at> <86v82nbuwb.fsf@mail.linkov.net> <69fcca8d-e043-4889-8f44-a14c93010f48@gmx.at> <867cf19t05.fsf@mail.linkov.net> <6e7f8be8-36bc-4963-b878-61ca96c92aaf@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="22213"; 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 Sat Jun 08 02:19:01 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 1sFjnR-0005fN-7Y for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 08 Jun 2024 02:19:01 +0200 Original-Received: from [::1] (helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sFd72-0001dr-Ix; Fri, 07 Jun 2024 13:10:48 -0400 Original-Received: from [2001:470:142:3::10] (helo=eggs.gnu.org) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sFd70-0001dj-LV for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 13:10:46 -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 1sFd70-00057u-Dt for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 13:10:46 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sFd7F-0002hj-LI for bug-gnu-emacs@gnu.org; Fri, 07 Jun 2024 13:11:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 07 Jun 2024 17:11: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.171778021910274 (code B ref 70949); Fri, 07 Jun 2024 17:11:01 +0000 Original-Received: (at 70949) by debbugs.gnu.org; 7 Jun 2024 17:10:19 +0000 Original-Received: from localhost ([127.0.0.1]:43660 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFd6Y-0002fb-D2 for submit@debbugs.gnu.org; Fri, 07 Jun 2024 13:10:19 -0400 Original-Received: from mslow1.mail.gandi.net ([217.70.178.240]:35349) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sFcsI-0007a6-0M; Fri, 07 Jun 2024 12:55:34 -0400 Original-Received: from relay6-d.mail.gandi.net (unknown [217.70.183.198]) by mslow1.mail.gandi.net (Postfix) with ESMTP id 25144C3491; Fri, 7 Jun 2024 16:47:25 +0000 (UTC) Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id C040DC0003; Fri, 7 Jun 2024 16:47:03 +0000 (UTC) In-Reply-To: <6e7f8be8-36bc-4963-b878-61ca96c92aaf@gmx.at> (martin rudalics's message of "Fri, 7 Jun 2024 10:23:25 +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:286799 Archived-At: close 70949 30.0.50 thanks >> Then let's install the first patch for (nil . ((some-window . mru))) >> that is not so controversial. > > OK with me. Very nice! So the original patch is pushed, and now the OP can happily use: (setq display-buffer-base-action '(nil . ((some-window . mru)))) and I can use: (defvar-local display-buffer-last-window nil) (setq display-buffer-base-action '(nil . ((some-window . (lambda (_buffer alist) (let ((last-window (buffer-local-value 'display-buffer-last-window (window-buffer)))) (or (and (window-live-p last-window) last-window) (get-mru-window nil nil t)))))))) (define-advice display-buffer-record-window (:after (type window buffer)) (with-current-buffer (window-buffer) (setq-local display-buffer-last-window window))) that works nicely even for showing buffers repeatedly in the selected window. And all commands are supported, even to show diffs from vc-dir.