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#62592: Not creating new Tabs with small window Date: Sun, 02 Apr 2023 20:49:09 +0300 Organization: LINKOV.NET Message-ID: <86v8ieb2g7.fsf@mail.linkov.net> References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="31796"; 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: 62592@debbugs.gnu.org To: Claudio Grondi Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 02 19:51:25 2023 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 1pj1rR-00082a-SE for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 02 Apr 2023 19:51:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pj1r7-0004eD-8J; Sun, 02 Apr 2023 13:51:05 -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 1pj1r5-0004dl-3E for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 13:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pj1r4-0003B1-RX for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 13:51:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pj1r4-0003Ds-E1 for bug-gnu-emacs@gnu.org; Sun, 02 Apr 2023 13:51:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 02 Apr 2023 17:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62592 X-GNU-PR-Package: emacs Original-Received: via spool by 62592-submit@debbugs.gnu.org id=B62592.168045780812111 (code B ref 62592); Sun, 02 Apr 2023 17:51:02 +0000 Original-Received: (at 62592) by debbugs.gnu.org; 2 Apr 2023 17:50:08 +0000 Original-Received: from localhost ([127.0.0.1]:42601 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj1qC-00039G-7I for submit@debbugs.gnu.org; Sun, 02 Apr 2023 13:50:08 -0400 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:53839) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj1qA-00038a-3K for 62592@debbugs.gnu.org; Sun, 02 Apr 2023 13:50:07 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9255EFF804; Sun, 2 Apr 2023 17:49:57 +0000 (UTC) In-Reply-To: <86sfdihj2o.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Apr 2023 09:52:31 +0300") 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:259122 Archived-At: --=-=-= Content-Type: text/plain >> 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 # 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? --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=split-window-window-min-height.patch 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) --=-=-=--