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#59862: quit-restore per window buffer Date: Fri, 12 Jul 2024 09:54:48 +0300 Organization: LINKOV.NET Message-ID: <867cdr3xs7.fsf@mail.linkov.net> References: <86fsds8mlm.fsf@mail.linkov.net> <86ttibq1w1.fsf@mail.linkov.net> <8243325e-ed03-4e9e-b64f-c8225fb6dc60@gmx.at> <18173da7-32e1-4f14-bbea-9a8fa66af7dd@gmx.at> <86plsxmc6d.fsf@mail.linkov.net> <86r0d4ezdc.fsf@mail.linkov.net> <0d01a044-d7d6-456a-9ba9-d987faad4332@gmx.at> <86frthjq4y.fsf@mail.linkov.net> <743dc4dd-cf09-4c5e-9209-b63a47480e0b@gmx.at> <86msnne7ut.fsf@mail.linkov.net> <86plsgrfvu.fsf@mail.linkov.net> <86le2b12ni.fsf@mail.linkov.net> <86y169kafb.fsf@mail.linkov.net> <61c4f245-3dd8-4e24-9c84-7ddd4cfe3c49@gmx.at> <86a5ioo269.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15341"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 59862@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Jul 12 08:56:39 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 1sSACs-0003qC-Oj for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 12 Jul 2024 08:56:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sSACM-0002Cz-6D; Fri, 12 Jul 2024 02:56:06 -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 1sSACK-0002Cg-AW for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:56:04 -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 1sSACJ-0000dl-W0 for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:56:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sSACI-00020y-5C for bug-gnu-emacs@gnu.org; Fri, 12 Jul 2024 02:56: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: Fri, 12 Jul 2024 06:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59862 X-GNU-PR-Package: emacs Original-Received: via spool by 59862-submit@debbugs.gnu.org id=B59862.17207673277695 (code B ref 59862); Fri, 12 Jul 2024 06:56:02 +0000 Original-Received: (at 59862) by debbugs.gnu.org; 12 Jul 2024 06:55:27 +0000 Original-Received: from localhost ([127.0.0.1]:53049 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSABj-000203-Du for submit@debbugs.gnu.org; Fri, 12 Jul 2024 02:55:27 -0400 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58887) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sSABh-0001zp-Bx for 59862@debbugs.gnu.org; Fri, 12 Jul 2024 02:55:25 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 24898C0009; Fri, 12 Jul 2024 06:55:15 +0000 (UTC) In-Reply-To: (martin rudalics's message of "Thu, 11 Jul 2024 10:36:46 +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:288762 Archived-At: >> I checked that prev-buffers is nil in both frame and tab cases, >> so everything is correct here. > > It's not correct in the sense that in the tab case the window showing > *info* had a previous buffer - *scratch*. Think of users working on > some buffer who want to consult Info on something in that buffer with > the intention to turn back to that buffer as soon as they are done. > While consulting *info* they hit C-h e. Now quitting *info* would > delete the window showing *info* and leave them with a window showing > *Messages* instead. Is that really the behavior you have in mind? How > would a user go back to the original buffer? The tab case should not differ from the frame case that has no previous buffer. >> The difference between frame and tab case is that the frame branch >> calls 'window--delete' that decides whether to delete the frame, >> or just delete the window. But in the tab case it either >> closes the tab, or does nothing. So in the tab case >> it should call 'window--delete' as well, that will decide >> whether to close the tab, or just delete the window. >> >> Then 'window--delete' should do something like this: >> >> (unless (and dedicated-only (not (window-dedicated-p window))) >> (let ((deletable (window-deletable-p window))) >> (cond >> + ((eq deletable 'tab) >> + (tab-bar-close-tab) >> + 'tab) >> ((eq deletable 'frame) >> (let ((frame (window-frame window))) >> (cond >> >> Then maybe 'seq-count' with (window-parameter w 'quit-restore) >> should be moved to 'window-deletable-p'. > > IIUC when 'display-buffer-record-window' installs a 'quit-restore' > parameter of the 'tab' type, it assumes full responsibility for all > windows on that frame as long as the corresponding tab has not been > closed. This means that the tab code has to assure a coherent state of > the frame's windows after the tab has been closed. If you can guarantee > that, feel free to move that check wherever you want. Ok, I will try to move it.