From: Juri Linkov <juri@linkov.net>
To: Claudio Grondi <claudio.grondi@freenet.de>
Cc: 62592@debbugs.gnu.org
Subject: bug#62592: Not creating new Tabs with small window
Date: Sun, 02 Apr 2023 20:49:09 +0300 [thread overview]
Message-ID: <86v8ieb2g7.fsf@mail.linkov.net> (raw)
In-Reply-To: <86sfdihj2o.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Apr 2023 09:52:31 +0300")
[-- Attachment #1: Type: text/plain, Size: 751 bytes --]
>> 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.
Oh, I noticed the same problem in window-state-put too :-(
Restoring window states fails with the same error in narrow windows.
However, here is a fix. Eli, is it ok to fix this in emacs-29?
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: split-window-window-min-height.patch --]
[-- Type: text/x-diff, Size: 1132 bytes --]
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)
next prev parent reply other threads:[~2023-04-02 17:49 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 [this message]
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
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=86v8ieb2g7.fsf@mail.linkov.net \
--to=juri@linkov.net \
--cc=62592@debbugs.gnu.org \
--cc=claudio.grondi@freenet.de \
/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).