From: martin rudalics <rudalics@gmx.at>
To: Juri Linkov <juri@linkov.net>
Cc: 62592@debbugs.gnu.org
Subject: bug#62592: Not creating new Tabs with small window
Date: Wed, 17 May 2023 09:07:21 +0200 [thread overview]
Message-ID: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> (raw)
In-Reply-To: <868rdokw73.fsf@mail.linkov.net>
>>>> 1. ~ $ emacs -Q
>>>> 2. Menu -> Options -> Show/Hide -> Tab Bar (gives Tab *scratch*)
>>>> 3. resize the Emacs window to a small one, but large enough to show some Tab labels
>>>> 3. 1x click on rightmost * in the Tab Bar to create a new Tab
>>>>
>>>> The bug: No new Tab will be created and the minibuf and*Messages* show:
>>>>
>>>> split-window: Window #<window 3 on*Messages*> too small for splitting
>>>
>>> Thanks for the bug report. It is related to bug#62427 where
>>> we need to find a way to create a new window without using
>>> delete-windows and split-window.
>
> The patch below still fails when the height of the window is 1 line.
>
> Maybe Martin could help?
>
>> diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
>> index 35474e1c674..08f904ec73d 100644
>> --- a/lisp/tab-bar.el
>> +++ b/lisp/tab-bar.el
>> @@ -1586,7 +1595,8 @@ 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))))
>> + (let ((window-min-height 1)) (split-window))
>> + (delete-window))))
>>
>> (let ((buffer
>> (if (and (functionp tab-bar-new-tab-choice)
>> diff --git a/lisp/window.el b/lisp/window.el
>> index aa7520f30fa..b2ee869940a 100644
>> --- a/lisp/window.el
>> +++ b/lisp/window.el
>> @@ -6391,7 +6396,8 @@ 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 (let ((window-min-height 1))
>> + (split-window window))
>> (delete-window window)))))
>>
>> (set-window-dedicated-p window nil)
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'.
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.
martin
next prev parent reply other threads:[~2023-05-17 7:07 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 [this message]
2023-05-17 16:46 ` Juri Linkov
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=5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at \
--to=rudalics@gmx.at \
--cc=62592@debbugs.gnu.org \
--cc=juri@linkov.net \
/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).