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: Wed, 17 May 2023 19:46:31 +0300 Organization: LINKOV.NET Message-ID: <86sfbulwfc.fsf@mail.linkov.net> References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> <868rdokw73.fsf@mail.linkov.net> <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2079"; 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: martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 17 19:20:30 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 1pzKpC-0000SU-M2 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 17 May 2023 19:20:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pzKoo-0004wp-1D; Wed, 17 May 2023 13:20:06 -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 1pzKom-0004vl-H8 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 13:20:04 -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 1pzKom-0007Ax-67 for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 13:20:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pzKom-0002Rh-1s for bug-gnu-emacs@gnu.org; Wed, 17 May 2023 13:20:04 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 May 2023 17:20:04 +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.16843439989348 (code B ref 62592); Wed, 17 May 2023 17:20:04 +0000 Original-Received: (at 62592) by debbugs.gnu.org; 17 May 2023 17:19:58 +0000 Original-Received: from localhost ([127.0.0.1]:50872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzKog-0002Qi-3M for submit@debbugs.gnu.org; Wed, 17 May 2023 13:19:58 -0400 Original-Received: from relay8-d.mail.gandi.net ([217.70.183.201]:38283) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzKod-0002Q3-2U for 62592@debbugs.gnu.org; Wed, 17 May 2023 13:19:55 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6910E1BF206; Wed, 17 May 2023 17:19:48 +0000 (UTC) In-Reply-To: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> (martin rudalics's message of "Wed, 17 May 2023 09:07:21 +0200") 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:261872 Archived-At: >>>>> 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 # 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)