From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#62592: Not creating new Tabs with small window Date: Wed, 17 May 2023 09:07:21 +0200 Message-ID: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> <868rdokw73.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11978"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 62592@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 17 09:08:32 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 1pzBGy-0002wZ-6B for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 09:08:32 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzBGW-0007jE-PI; Wed, 17 May 2023 03:08:04 -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 1pzBGU-0007j1-9e for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 03:08: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 1pzBGU-0006sI-1y for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 03:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzBGT-00012s-SD for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 03:08:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 07:08:01 +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.16843072553975 (code B ref 62592); Wed, 17 May 2023 07:08:01 +0000 Original-Received: (at 62592) by debbugs.gnu.org; 17 May 2023 07:07:35 +0000 Original-Received: from localhost ([127.0.0.1]:48716 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzBG2-000122-SN for submit@debbugs.gnu.org; Wed, 17 May 2023 03:07:35 -0400 Original-Received: from mout.gmx.net ([212.227.17.21]:41153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzBFx-00011l-Fy for 62592@debbugs.gnu.org; Wed, 17 May 2023 03:07:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1684307243; i=rudalics@gmx.at; bh=7Euc7JHOnNpLG8dWyBVw1Q3hYFpgiJkIcIN5IIhMHvI=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=HNtsLEnr/XeCqClPpTGZMoIi6+5m3NnArGY0Fyn/Dy101ryfKr6MPBxL29SuIagJ+ 3WdCj9ZgZKshV6GWOOxaZwM3V809L6Fi8hvD1rKu1hrF8EN/w+GpSK5Ted8RGZy2rv lkFF6rHwuc8KUyAJTlmhkiJB4qUbF48lBpddQCci8/I6oV0nLxLf8gAYCGszc88lHw EgAJr/XLKsOrg9wnVtNRXDt1jZ8MWAsI0j6F2ptVdDJ/m4M9OEMqneZF/WxPpN2gj2 t96/vzuLpHcmiNDEkvMIOxp3BZCvPpa2VEpgVA53zpKMcPP6bxGdR32OgbM6TMdh15 WiigRLuJS4Lrw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.100] ([212.95.5.123]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MGhuU-1pvHVA3sIM-00Do19; Wed, 17 May 2023 09:07:23 +0200 Content-Language: en-US In-Reply-To: <868rdokw73.fsf@mail.linkov.net> X-Provags-ID: V03:K1:Z04QnEyUM43gPjp5BxxJ4t2CzEVtNhzkBBnmGt3eK7dsnz8ftxo 9qlEy5oc01cfe+fDSA1qsWA+Zl+Dl5p5Z//Bsr35U5JX1gXiyus4SBozxDLyxiuNPQr8zIX cF6uiiv+0xSy8MBftm/suWtCNnsg2quka0DldwQNQQrP0PqbgktD7cz4juGlg5894+PqPSH MQcJmHbOYw3csUIK2sEjA== UI-OutboundReport: notjunk:1;M01:P0:u7USQjaNYVE=;UfHvQ6Lvcng92Da2FnfeBxXznDy lw1/N1z+E3XesJbcH5h1yzweZaOb7TFJF+iMOZLyn3IyE49xiq0rn3u1w804+tFKLFrgzq1as yUJkiynFKxvXlaFVdemu2U1MqYxrv9xjtq67klJBIeM+Swha38MhzgOVDP1xe+xnQ7VC2p2l2 xa3sy4t/h+WQ2CSQmkzLi1NljRVlp8/GXI0RvPAoGR+UFTO7QQ+7y/ep8pacTP/k+6dHlCYrx YU16guSszAXM/gb+CxI5WrqWm9xu66FJhmHyWUP2ApAqI8ZGYf9auH7TVZPis5JL7ZcTSz+ex r4aDFpmxMm/2lk/ovv4mA5oZgX7phyaDkfViwTfhIOrozRyHZjnSQe9BWNtzVD51mH1fXBGtq KQi6nsmZo8IBzBobsEPlZK3ispTivlBhLK2cfxx46zZfY/8imxTSPgJyDtnZ+9PHsyNo0efyE fJvOZM6gswr086+OMOTuZ0BwLf6/xmNb88zYQyxzyQsc9bfPYIU+lLzxe8yIC8Su7av30DHX6 bWaQL2VSTiHczQwn6My244Lm8aQOeSY/XbOjaWNirLFitdwSyeNnei0I0R7UNmGfpDeRTrTZL wX41vL3Iy1JE5DxvM2Br1rMplx7bL7dtPxTb5tE42EEdzan5pezm6B/0RH7t/RQEOw5HSVezf 8i21cZoh2HoUP8pC7OAm38JsMLlqpcMp9MMv2OnTHd7Oxyykf9/i91LCWT1OQGh4qzlCdygAN ikxIhTW/XnjCApKy9SuEPN8VhHtOpktCbIlQBHI+gIfGOt29VACGRiq2SE+zvV4RX1twsjWj 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:261826 Archived-At: >>>> 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. > > 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