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#59862: quit-restore per window buffer Date: Thu, 11 Jul 2024 10:36:46 +0200 Message-ID: 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> 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="11656"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 59862@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jul 11 10:37:24 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 1sRpIp-0002kZ-Ph for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Jul 2024 10:37:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sRpIX-0007Ow-Aw; Thu, 11 Jul 2024 04:37:05 -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 1sRpIV-0007Hk-Dg for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 04:37:03 -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 1sRpIV-0007Hb-4R for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 04:37:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sRpIU-00053m-IQ for bug-gnu-emacs@gnu.org; Thu, 11 Jul 2024 04:37:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jul 2024 08:37: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.172068701519435 (code B ref 59862); Thu, 11 Jul 2024 08:37:02 +0000 Original-Received: (at 59862) by debbugs.gnu.org; 11 Jul 2024 08:36:55 +0000 Original-Received: from localhost ([127.0.0.1]:50992 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRpIM-00053P-Sc for submit@debbugs.gnu.org; Thu, 11 Jul 2024 04:36:55 -0400 Original-Received: from mout.gmx.net ([212.227.15.18]:34303) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sRpIL-00053B-AR for 59862@debbugs.gnu.org; Thu, 11 Jul 2024 04:36:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1720687007; x=1721291807; i=rudalics@gmx.at; bh=hs56+dRhwD4GGyKsvgnnHOiq/M44n7UsWRoX0xrC+Ak=; 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=HDCsuEzm6v9iJ4GDSBvKLfg9e4FznXnyesBIJUYTm1E1E1w0UZLkIwRC32T/wk/0 jqEm8OJ4juWYGle6PHr4v8ka22WDtMhA3/nG6Afz9qRGQh0ZVLrWMDmB2VRl2ssaz 8BLVK9Yml+yrJSvO0jW3mkEO8aTF99q9ooOL54ZinQpDxX+oXq8NH2AIBMYBidLsy im2EJD2n9cOaxJWVx41S9MjrCoKT3I9k7X5dNDk5z3oR+51E6UzmAKB3NWGMklqlA jERqusw18xkKs2H832Muq3B+zIpSl3u4kdrrKRXuNZ9ZKb/0KkzDOHHboC0sTQhVl COUcWU0Zd3B3jUpi2Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([212.95.8.206]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mnps0-1s2x0904uQ-00jdYH; Thu, 11 Jul 2024 10:36:47 +0200 Content-Language: en-US In-Reply-To: <86a5ioo269.fsf@mail.linkov.net> X-Provags-ID: V03:K1:WYZtfpE7X5V3Wqi+3KBX4isaByPU5Mwr2GBirqoigkTNWmEKL3L 7b356pUg1x95NhUb8OiU6ZqT0GpfACfMaJupUse1IAkrwWbtaDfpbSk12mqFjRB5gLY1YMI AS5C/NVzvpnsrvSngXIuPtb1wxBJdOVJIS3PvClq2hi3muGyoD7/zXC7nZO/Mt2fFXJIfI1 BwbGibKZuU2pScx3X4M0Q== UI-OutboundReport: notjunk:1;M01:P0:gFApIb53e+I=;imkj/b+D31SDhBBagzp3zTr5ldm uAv3TZ/TxfoAEI0t3g2SOC0eljZ+rFE/RRINxd9NRU5gu5CCwDszT24P5fQthn7jV5KUB7VCE zuR3dz/1a9oniVqWd5Bzh5AcRrZBudMEazOeu3rGM3+I3BP6qlMbXj51coMkxFOwtXGyG9BYj pqAf+iOhlUdnKO6r0MhH+PjHvjxelD5Wcb5+bcG54qzFGtyLPYbh+9H8enwU/3CXCg35t3tUn JO7fNBumsEuYfOWoYgijfuNQamJmm0RUHw+9RtLKoc+k1rZ7P0d0bu5zVxr3FCTDv/aQ5x3Gd jdXY9PFIgVzaI0Xpl2scGsY0Klp8g9QVhRGOncnygcucgeWP5rkAA7Vq+E+KPD5IcRnaV+trY Hc4Tk2A3RWO+Ox/HJ80tLXDJb2NJGcerRqD8fXfjb+z0HL9InRJFHGEwfMpnQ2VglKdSeo2fG Xl/rA0oWxBta+f6hSNkYbB2oj1/Mf1Iw9nPIVp/uhoaX5zETXyG2T7EFPXm7Qz9e8/eZu/wdN VdcZ2D6Ba7agHVW1nofZCxTE0wdv+11k9fEy/b32lHPqpYfHjqu0IHtGGN6JcZ4cjWRWJaAo0 u7vM8BEFe5RLMu6pL007pjDeX9AjZ3b4gpl5hp78gEXVXHlokYBlZXS9jsUWhyiK2WUR8tUgD W3Th2XMTMvDG6/vLLi7m4SGP51Oq5zrDgmjPbIec0roC99TD7MmKkQfSU96GsNrLEUTaw6my7 n4ZC3R2wlyE/9RKyY3R1B7C1+NDFJqaGbFIq+hsq2mrJ3PwnaQEmenUJFSA0npJZzwYvIv8w 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:288722 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 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. martin