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: Thu, 13 Jun 2024 09:47:09 +0300 Organization: LINKOV.NET Message-ID: <86frthjq4y.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21688"; 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: 59862@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Jun 13 09:16:28 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 1sHehA-0005X5-BW for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 13 Jun 2024 09:16:28 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sHeeq-0007YU-SU; Thu, 13 Jun 2024 03:14:04 -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 1sHeep-0007XQ-Bu for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 03:14: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 1sHeep-00077j-3G for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 03:14:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sHeeo-0003Y0-7z for bug-gnu-emacs@gnu.org; Thu, 13 Jun 2024 03:14: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: Thu, 13 Jun 2024 07:14: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.171826282013561 (code B ref 59862); Thu, 13 Jun 2024 07:14:02 +0000 Original-Received: (at 59862) by debbugs.gnu.org; 13 Jun 2024 07:13:40 +0000 Original-Received: from localhost ([127.0.0.1]:57865 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHeeR-0003We-Rb for submit@debbugs.gnu.org; Thu, 13 Jun 2024 03:13:40 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:52213) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sHeeQ-0003W7-GS for 59862@debbugs.gnu.org; Thu, 13 Jun 2024 03:13:39 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 4D66660008; Thu, 13 Jun 2024 07:13:10 +0000 (UTC) In-Reply-To: <0d01a044-d7d6-456a-9ba9-d987faad4332@gmx.at> (martin rudalics's message of "Wed, 12 Jun 2024 10:57:34 +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:287181 Archived-At: >> C-x 5 5 ;; other-frame-prefix >> C-h i ;; info >> q ;; quit-window >> This deletes the frame. >> >> C-x 5 5 ;; other-frame-prefix >> C-h i ;; info >> C-h e ;; view-echo-area-messages >> q ;; quit-window >> This doesn't delete the frame because another buffer was used. > > Here it doesn't delete the frame because it contains two windows. > 'quit-window' deletes the *info* window and the *Messages* window > remains. When I do C-x o q q instead it first shows the *info* window > only and then deletes the frame just as I would expect. The current behavior for frames looks correct. > BTW 'view-echo-area-messages' has a bug: The 'goto-char' moves point in > the *Messages* buffer in an undocumented manner. It should be written > as: > > (defun view-echo-area-messages () > "View the log of recent echo-area messages: the `*Messages*' buffer. > The number of messages retained in that buffer is specified by > the variable `message-log-max'." > (interactive) > (when-let ((win (display-buffer (messages-buffer)))) > (set-window-point win (point-max)) > win)) Agreed. >> So frames are handled correctly. But not tabs: >> >> C-x t t ;; other-tab-prefix >> C-h i ;; info >> q ;; quit-window >> This correctly closes the tab. >> >> C-x t t ;; other-tab-prefix >> C-h i ;; info >> C-h e ;; view-echo-area-messages >> q ;; quit-window >> But this also closes the tab, this is a destructive operation, >> because the user has another buffer shown in the tab. > > Here I get two windows. The 'quit-restore' parameter of the *info* > window is > > (tab tab # #) > > that of the *Messages* window is > > (window window # #). > > So if I now do q in the *info* window, it will run 'tab-bar-close-tab'. > It's up to that function to DTRT here. Could you show how the frame function corresponding to 'tab-bar-close-tab' (I suppose it's 'delete-frame'?) detects that where are more than 1 window on the frame, then it refuses to delete the frame. Then same code could be used in 'tab-bar-close-tab'.