unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Juri Linkov <juri@linkov.net>
To: martin rudalics <rudalics@gmx.at>
Cc: Eli Zaretskii <eliz@gnu.org>,
	abdo.haji.ali@gmail.com, 71386@debbugs.gnu.org
Subject: bug#71386: 29.1; Frame is auto-deleted even when it has multiple tabs
Date: Mon, 17 Jun 2024 09:16:44 +0300	[thread overview]
Message-ID: <861q4w14c3.fsf@mail.linkov.net> (raw)
In-Reply-To: <86a5jksv4k.fsf@mail.linkov.net> (Juri Linkov's message of "Sun,  16 Jun 2024 19:45:55 +0300")

>> +     ((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





  reply	other threads:[~2024-06-17  6:16 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-05 23:44 bug#71386: 29.1; Frame is auto-deleted even when it has multiple tabs Al Haji-Ali
2024-06-06  5:45 ` Eli Zaretskii
2024-06-06  6:12   ` Juri Linkov
2024-06-06  9:20     ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-06 10:10     ` Eli Zaretskii
2024-06-06  9:19   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-07  6:39     ` Juri Linkov
2024-06-07  8:23       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-07 17:20         ` Juri Linkov
2024-06-07 17:52           ` Eli Zaretskii
2024-06-07 18:16             ` Juri Linkov
2024-06-07 18:44               ` Al Haji-Ali
2024-06-09 16:59                 ` Juri Linkov
2024-06-09 17:46                   ` Eli Zaretskii
2024-06-09 17:58                     ` Juri Linkov
2024-06-09 18:16                       ` Eli Zaretskii
2024-06-09 18:28                         ` Juri Linkov
2024-06-10  8:00                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-11  6:58                             ` Juri Linkov
2024-06-11 16:26                               ` Al Haji-Ali
2024-06-13  6:50                                 ` Juri Linkov
2024-06-12  8:57                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-13  6:53                                 ` Juri Linkov
2024-06-13  8:21                                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-14  6:13                                     ` Juri Linkov
2024-06-14 17:46                                     ` Juri Linkov
2024-06-15  8:42                                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-16  6:58                                         ` Juri Linkov
2024-06-16  7:52                                           ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-16 10:50                                             ` Al Haji-Ali
2024-06-17 14:47                                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-17 16:08                                                 ` Al Haji-Ali
2024-06-17 16:47                                                   ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-17 17:01                                                     ` Al Haji-Ali
2024-06-18  9:52                                                       ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-18 19:04                                                         ` Al Haji-Ali
2024-06-19  6:24                                                           ` Juri Linkov
2024-06-19  9:37                                                             ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-20  6:48                                                               ` Juri Linkov
2024-06-20  9:29                                                                 ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-16 16:45                                             ` Juri Linkov
2024-06-17  6:16                                               ` Juri Linkov [this message]
2024-06-17 14:47                                               ` martin rudalics via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-06-07 19:50               ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=861q4w14c3.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=71386@debbugs.gnu.org \
    --cc=abdo.haji.ali@gmail.com \
    --cc=eliz@gnu.org \
    --cc=rudalics@gmx.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).