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#71386: 29.1; Frame is auto-deleted even when it has multiple tabs Date: Mon, 17 Jun 2024 09:16:44 +0300 Organization: LINKOV.NET Message-ID: <861q4w14c3.fsf@mail.linkov.net> References: <8561a63a-66d3-44cd-872f-73d26af7edbe@gmx.at> <86msnw4qm4.fsf@mail.linkov.net> <86y17gej2x.fsf@gnu.org> <86y17gmxdg.fsf@mail.linkov.net> <868qzehxie.fsf@mail.linkov.net> <86msnu9fhg.fsf@gnu.org> <86zfruc7qh.fsf@mail.linkov.net> <86ikyi9e2l.fsf@gnu.org> <86o78ac6ny.fsf@mail.linkov.net> <0ab646c8-ff46-4c27-acbf-b5f4b8ab06fd@gmx.at> <86frtkeyzo.fsf@mail.linkov.net> <811654d9-bde2-4ba5-bbeb-15db0d7dcf00@gmx.at> <86r0d1iaxc.fsf@mail.linkov.net> <8634pfe735.fsf@mail.linkov.net> <2b0260af-82f1-4c08-9d15-dd4f3f40d13d@gmx.at> <86frtdtlns.fsf@mail.linkov.net> <86a5jksv4k.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="22449"; 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: Eli Zaretskii , abdo.haji.ali@gmail.com, 71386@debbugs.gnu.org To: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jun 17 08:18: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 1sJ5hD-0005fN-EG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 17 Jun 2024 08:18:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sJ5gn-0008N7-BW; Mon, 17 Jun 2024 02:18:01 -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 1sJ5gm-0008MY-EC for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 02:18:00 -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 1sJ5gm-0001mp-6H for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 02:18:00 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sJ5gn-0007gH-V0 for bug-gnu-emacs@gnu.org; Mon, 17 Jun 2024 02:18: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: Mon, 17 Jun 2024 06:18:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71386 X-GNU-PR-Package: emacs Original-Received: via spool by 71386-submit@debbugs.gnu.org id=B71386.171860507129508 (code B ref 71386); Mon, 17 Jun 2024 06:18:01 +0000 Original-Received: (at 71386) by debbugs.gnu.org; 17 Jun 2024 06:17:51 +0000 Original-Received: from localhost ([127.0.0.1]:59317 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJ5gc-0007fs-KC for submit@debbugs.gnu.org; Mon, 17 Jun 2024 02:17:50 -0400 Original-Received: from relay4-d.mail.gandi.net ([217.70.183.196]:57321) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sJ5gb-0007fT-1R for 71386@debbugs.gnu.org; Mon, 17 Jun 2024 02:17:49 -0400 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id 5F31BE0007; Mon, 17 Jun 2024 06:17:37 +0000 (UTC) In-Reply-To: <86a5jksv4k.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 16 Jun 2024 19:45:55 +0300") 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:287358 Archived-At: >> + ((and tab-bar-mode (> (length (funcall tab-bar-tabs-function frame)) 1)) >> + 'tab) >> >> How would users get back the old behavior? By customizing >> 'tab-bar-close-last-tab-choice', 'tab-bar-tab-prevent-close-functions'? > > This patch just copies the logic of frame handling to tab handling. > There is no customization for frame handling, so there is > no customization for tab handling. > > In window-deletable-p there is hard-coded 'frame-root-window-p' > that checks if the frame has only 1 window. So the patch > does the same by checking if there is only 1 tab on the frame. > > Also in window--delete the call of 'tab-bar-close-tab' > corresponds to the call 'delete-frame'. Please see a more correct patch: diff --git a/lisp/window.el b/lisp/window.el index cf5c07395ab..588014b8f77 100644 --- a/lisp/window.el +++ b/lisp/window.el @@ -4138,7 +4138,9 @@ window-deletable-p (not (eq (default-toplevel-value 'minibuffer-follows-selected-frame) t))))) - 'frame)) + (if (and tab-bar-mode (> (length (funcall tab-bar-tabs-function frame)) 1)) + 'tab + 'frame))) ((window-minibuffer-p window) ;; If WINDOW is the minibuffer window of a non-minibuffer-only ;; frame, it cannot be deleted separately. @@ -4979,6 +4981,9 @@ window--delete (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