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: 62592@debbugs.gnu.org
Subject: bug#62592: Not creating new Tabs with small window
Date: Wed, 17 May 2023 19:46:31 +0300	[thread overview]
Message-ID: <86sfbulwfc.fsf@mail.linkov.net> (raw)
In-Reply-To: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> (martin rudalics's message of "Wed, 17 May 2023 09:07:21 +0200")

>>>>> 3. resize the Emacs window to a small one, but large enough to show some Tab labels
>>>>> 4. 1x click on rightmost * in the Tab Bar to create a new Tab
>>>>>     split-window: Window #<window 3 on*Messages*> too small for splitting
>>> -      (setq window (prog1 (split-window window)
>>> +      (setq window (prog1 (let ((window-min-height 1))
>>> +                            (split-window window))
>
> Split the window horizontally.  If a user can see the "+" button on the
> tab bar, the containing frame should be wide enough to accommodate two
> side-by-side windows.  Also it's always better to specify an explicit
> SIZE argument to make a small window than to bind 'window-min-height'.

Thanks for the suggestion.  Empirically I found that
'(split-window-horizontally 1)' always fails.
So the next patch uses '(split-window-horizontally 2)'.

> For Emacs 30 I'd recommend a new routine say 'clean-window' to make its
> argument window pristine.  The way you do it now loses all overlays with
> a window property in the window's buffer.

The purpose of this trick is to change window identity.  So maybe
a better name would be 'clone-window'?

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 9d703b5d048..43c24eb46ad 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -1585,7 +1585,7 @@ tab-bar-new-tab-to
               (window-state-put (window-state-get))
             ;; Create a new window to get rid of old window parameters
             ;; (e.g. prev/next buffers) of old window.
-            (split-window) (delete-window))))
+            (split-window-horizontally 2) (delete-window))))
 
       (let ((buffer
              (if (and (functionp tab-bar-new-tab-choice)
diff --git a/lisp/window.el b/lisp/window.el
index aa7520f30fa..1b497254a02 100644
--- a/lisp/window.el
+++ b/lisp/window.el
@@ -6391,7 +6391,7 @@ window-state-put
                      (selected-window)))
       (delete-other-windows-internal window root)
       ;; Create a new window to replace the existing one.
-      (setq window (prog1 (split-window window)
+      (setq window (prog1 (split-window-horizontally 2 window)
                      (delete-window window)))))
 
   (set-window-dedicated-p window nil)





  reply	other threads:[~2023-05-17 16:46 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-01 12:48 bug#62592: Not creating new Tabs with small window Claudio Grondi
2023-04-02  6:52 ` Juri Linkov
2023-04-02 17:49   ` Juri Linkov
2023-04-02 18:02     ` Eli Zaretskii
2023-04-25 17:28       ` Juri Linkov
2023-05-16 17:34     ` Juri Linkov
2023-05-17  7:07       ` martin rudalics
2023-05-17 16:46         ` Juri Linkov [this message]
2023-05-18  8:30           ` martin rudalics
2023-05-18 15:50             ` Juri Linkov
2023-05-19  7:31               ` martin rudalics
2023-05-19 18:04                 ` Juri Linkov

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=86sfbulwfc.fsf@mail.linkov.net \
    --to=juri@linkov.net \
    --cc=62592@debbugs.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).