From unknown Wed Jun 18 23:05:39 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#62592 <62592@debbugs.gnu.org> To: bug#62592 <62592@debbugs.gnu.org> Subject: Status: Not creating new Tabs with small window Reply-To: bug#62592 <62592@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:05:39 +0000 retitle 62592 Not creating new Tabs with small window reassign 62592 emacs submitter 62592 Claudio Grondi severity 62592 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Apr 01 08:48:56 2023 Received: (at submit) by debbugs.gnu.org; 1 Apr 2023 12:48:56 +0000 Received: from localhost ([127.0.0.1]:35689 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piaf9-00007o-II for submit@debbugs.gnu.org; Sat, 01 Apr 2023 08:48:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:50516) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piaf7-00007f-TF for submit@debbugs.gnu.org; Sat, 01 Apr 2023 08:48:54 -0400 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 1piaf2-0002nw-Ij for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 08:48:49 -0400 Received: from mout2.freenet.de ([2001:748:100:40::2:4]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piaez-00026i-0f for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 08:48:47 -0400 Received: from [195.4.92.120] (helo=sub1.freenet.de) by mout2.freenet.de with esmtpa (ID claudio.grondi@freenet.de) (port 25) (Exim 4.94.2 #2) id 1piaet-00GS5f-OM for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 14:48:41 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=freenet.de; s=mjaymdexmjqk; h=Content-Transfer-Encoding:Content-Type:Subject:From:To: MIME-Version:Date:Message-ID:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Jks1N05vDgVVqV9LMP+hQOSyv3Szv9nOw5mF6cAq+QI=; b=xgsSb4xdOqSx4fol+kEdmnmKAG ljZdRg7/QO9l/ElS00oZ5oxXjaECm4yGxFrbJzJL8k2pwdfZMgX3BA6/FAxjbS4Egu39vBFIVHhzF 5vLc7otL4weeVHyuPCo2Wxmy8iWxJSFP8RXPju5VSsuKu3YusP00/zPjYfWYgX2e00SWEz8azlc+E mRos1ZcgojNR1hvBd3ahRR8Pa9NuGARF3kolbSuZwj9r7WwkbeU9kcM+PyzeLQBi/c62jWc7xCRW+ B32+DDpKbzIDyjjUmPLdXZSgfR1OWcZCX7tKhVptFKg16jpdlun2hsss8UR/oKYtYsthsecYP22Ob S7jNKArQ==; Received: from ip-109-42-240-50.web.vodafone.de ([109.42.240.50]:20082 helo=[192.168.8.100]) by sub1.freenet.de with esmtpsa (ID claudio.grondi@freenet.de) (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_128_GCM:128) (port 587) (Exim 4.94.2 #2) id 1piaeu-002dnl-Qw for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 14:48:40 +0200 Message-ID: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> Date: Sat, 1 Apr 2023 14:48:40 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Content-Language: de-DE, en-US To: bug-gnu-emacs@gnu.org From: Claudio Grondi Subject: Not creating new Tabs with small window Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-FN-MUUID: 16803533208EF9BFAA1717O X-Originated-At: 109.42.240.50!20082 X-Scan-TS: Sat, 01 Apr 2023 14:48:40 +0200 Received-SPF: pass client-ip=2001:748:100:40::2:4; envelope-from=prvs=0455f10216=claudio.grondi@freenet.de; helo=mout2.freenet.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) 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 To: bug-gnu-emacs@gnu.org Subject: 29.0.60; Not creating new Tabs with small window --text follows this line-- In GNU Emacs 29.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo  version 1.16.0, Xaw3d scroll bars) of 2023-03-30 built on OoO Repository revision: 4508a024e81834cfb01c6f7984182e1a6cbb91ea Repository branch: emacs-29 Windowing system distributor 'The X.Org Foundation', version 11.0.12101003 System Description: Linux Mint 21 Configured using:  'configure --with-x-toolkit=lucid --with-imagemagick' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ IMAGEMAGICK JPEG LCMS2 LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XAW3D XDBE XIM XINPUT2 XPM LUCID ZLIB Important settings:   value of $LC_MONETARY: C.UTF-8   value of $LC_NUMERIC: C.UTF-8   value of $LC_TIME: C.UTF-8   value of $LANG: C.UTF-8   value of $XMODIFIERS: @im=none   locale-coding-system: utf-8-unix Major mode: Messages Minor modes in effect:   shell-dirtrack-mode: t   savehist-mode: t   desktop-save-mode: t   display-time-mode: t   delete-selection-mode: t   save-place-mode: t   cua-mode: t   tooltip-mode: t   global-eldoc-mode: t   show-paren-mode: t   electric-indent-mode: t   mouse-wheel-mode: t   tool-bar-mode: t   tab-bar-mode: t   menu-bar-mode: t   file-name-shadow-mode: t   global-font-lock-mode: t   font-lock-mode: t   blink-cursor-mode: t   buffer-read-only: t   column-number-mode: t   line-number-mode: t   indent-tabs-mode: t   transient-mark-mode: t   auto-composition-mode: t   auto-encryption-mode: t   auto-compression-mode: t Load-path shadows: /home/neo/.emacs.d/elpa/svg-1.1/svg hides /usr/local/share/emacs/29.0.60/lisp/svg /home/neo/.emacs.d/elpa/cl-lib-0.7.1/cl-lib hides /usr/local/share/emacs/29.0.60/lisp/emacs-lisp/cl-lib Features: (shadow sort mail-extr emacsbug message yank-media puny rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils sh-script smie executable tramp-archive tramp-gvfs tramp-cache time-stamp zeroconf dbus xml tramp tramp-loaddefs trampver tramp-integration files-x tramp-compat shell pcomplete parse-time iso8601 ls-lisp format-spec dired-aux dired dired-loaddefs tab-line autorevert filenotify time-date python rx project pcase treesit comint ansi-osc ring ansi-color nlinum linum finder-inf find-desktop savehist desktop frameset time cl-extra help-mode icons delsel saveplace cua-base cus-load moe-theme-autoloads system-packages-autoloads rainbow-mode-autoloads paredit-autoloads info orderless-autoloads mines-autoloads luwak-autoloads tiny-autoloads which-key-autoloads transwin-autoloads edit-indirect-autoloads shell-command+-autoloads dired-du-autoloads svg-autoloads svg-lib-autoloads smooth-scroll-autoloads treeview-autoloads ascii-art-to-unicode-autoloads vlf-autoloads smartparens-autoloads grip-mode-autoloads wgrep-autoloads good-scroll-autoloads sublimity-autoloads nlinum-autoloads elisp-slime-nav-autoloads minimap-autoloads relint-autoloads xr-autoloads package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify lcms2 dynamic-setting system-font-setting font-render-setting cairo x-toolkit xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 232088 15236)  (symbols 48 16510 0)  (strings 32 76078 3220)  (string-bytes 1 2024728)  (vectors 16 28773)  (vector-slots 8 437311 17063)  (floats 8 89 182)  (intervals 56 2531 813)  (buffers 984 24)) From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 03:02:21 2023 Received: (at 62592) by debbugs.gnu.org; 2 Apr 2023 07:02:21 +0000 Received: from localhost ([127.0.0.1]:39165 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pirjJ-0003tz-0Q for submit@debbugs.gnu.org; Sun, 02 Apr 2023 03:02:21 -0400 Received: from relay3-d.mail.gandi.net ([217.70.183.195]:47205) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pirjI-0003tZ-9k for 62592@debbugs.gnu.org; Sun, 02 Apr 2023 03:02:20 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 4493960006; Sun, 2 Apr 2023 07:02:12 +0000 (UTC) From: Juri Linkov To: Claudio Grondi Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> (Claudio Grondi's message of "Sat, 1 Apr 2023 14:48:40 +0200") Organization: LINKOV.NET References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> Date: Sun, 02 Apr 2023 09:52:31 +0300 Message-ID: <86sfdihj2o.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > 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. From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 13:50:08 2023 Received: (at 62592) by debbugs.gnu.org; 2 Apr 2023 17:50:08 +0000 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 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 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9255EFF804; Sun, 2 Apr 2023 17:49:57 +0000 (UTC) From: Juri Linkov To: Claudio Grondi Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <86sfdihj2o.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Apr 2023 09:52:31 +0300") Organization: LINKOV.NET References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> Date: Sun, 02 Apr 2023 20:49:09 +0300 Message-ID: <86v8ieb2g7.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) --=-=-= 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) --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sun Apr 02 14:02:04 2023 Received: (at 62592) by debbugs.gnu.org; 2 Apr 2023 18:02:04 +0000 Received: from localhost ([127.0.0.1]:42616 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj21k-0003fC-7c for submit@debbugs.gnu.org; Sun, 02 Apr 2023 14:02:04 -0400 Received: from eggs.gnu.org ([209.51.188.92]:53260) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pj21f-0003ee-W8 for 62592@debbugs.gnu.org; Sun, 02 Apr 2023 14:02:03 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj21Y-0005bo-WF; Sun, 02 Apr 2023 14:01:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TA03TdHGewczqe8x+UYJeeiEkHBht1byVG4hqDzW1Ek=; b=NFTRhG77Gbl6 yAeoFGJdEMlCVqEFEmanVshQeLCjdKsZAndIlkH3EE8EMYuZKai5sr9b0p9TNkNsuuQMnKNLqOICv GJKD2i+pvat2rSBPmU5LahJgUldJf0snUWQtzTD1VLUNf/PdMk/w1VMmi8RHnRMndwdtvoe0rjSNJ wSMZg5Jg6J+xuztliaCPepuV0RSTrmqLAw5sHis1inoOOMDgkV92erkfUpadbhyGmehsHRANj9mOx 147V+0MIOXPBDN2yl2IrQxu6Z7VB61R1gRqXOwzulnTgDG9Azr12L8ma+22yOnAjg3XfDhMKIztEv nnNrk4aBjfFWnWz+QMscOA==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pj21X-0007y0-K3; Sun, 02 Apr 2023 14:01:52 -0400 Date: Sun, 02 Apr 2023 21:02:10 +0300 Message-Id: <83edp2w4bh.fsf@gnu.org> From: Eli Zaretskii To: Juri Linkov , Benson Chu In-Reply-To: <86v8ieb2g7.fsf@mail.linkov.net> (message from Juri Linkov on Sun, 02 Apr 2023 20:49:09 +0300) Subject: Re: bug#62592: Not creating new Tabs with small window References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org, claudio.grondi@freenet.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > Cc: 62592@debbugs.gnu.org > From: Juri Linkov > Date: Sun, 02 Apr 2023 20:49:09 +0300 > > >> 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? Yes, although I cannot say I'm fond of such kludges. (I thought Benson Chu was working on a better fix for these problems?) From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 25 13:37:21 2023 Received: (at 62592) by debbugs.gnu.org; 25 Apr 2023 17:37:21 +0000 Received: from localhost ([127.0.0.1]:53515 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prMbR-0005jd-0a for submit@debbugs.gnu.org; Tue, 25 Apr 2023 13:37:21 -0400 Received: from relay11.mail.gandi.net ([217.70.178.231]:47307) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1prMbI-0005iy-UD for 62592@debbugs.gnu.org; Tue, 25 Apr 2023 13:37:14 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id F34B3100008; Tue, 25 Apr 2023 17:37:04 +0000 (UTC) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <83edp2w4bh.fsf@gnu.org> (Eli Zaretskii's message of "Sun, 02 Apr 2023 21:02:10 +0300") Organization: LINKOV.NET References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> <83edp2w4bh.fsf@gnu.org> Date: Tue, 25 Apr 2023 20:28:46 +0300 Message-ID: <86mt2vq3rd.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org, Benson Chu , claudio.grondi@freenet.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> >> 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? > > Yes, although I cannot say I'm fond of such kludges. > > (I thought Benson Chu was working on a better fix for these problems?) After bug#62427 was closed, this bug is still reproducible. The proposed patch remains the same. From debbugs-submit-bounces@debbugs.gnu.org Tue May 16 13:47:42 2023 Received: (at 62592) by debbugs.gnu.org; 16 May 2023 17:47:42 +0000 Received: from localhost ([127.0.0.1]:47653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyyly-0000Mp-9h for submit@debbugs.gnu.org; Tue, 16 May 2023 13:47:42 -0400 Received: from relay8-d.mail.gandi.net ([217.70.183.201]:34929) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pyylw-0000MF-OT for 62592@debbugs.gnu.org; Tue, 16 May 2023 13:47:41 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id C0B571BF206; Tue, 16 May 2023 17:47:33 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <86v8ieb2g7.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 02 Apr 2023 20:49:09 +0300") Organization: LINKOV.NET References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> Date: Tue, 16 May 2023 20:34:32 +0300 Message-ID: <868rdokw73.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>> 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) From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 03:07:35 2023 Received: (at 62592) by debbugs.gnu.org; 17 May 2023 07:07:35 +0000 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 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 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 Message-ID: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> Date: Wed, 17 May 2023 09:07:21 +0200 MIME-Version: 1.0 Subject: Re: bug#62592: Not creating new Tabs with small window Content-Language: en-US To: Juri Linkov References: <969620d8-8532-b23b-a870-c0852241160c@freenet.de> <86sfdihj2o.fsf@mail.linkov.net> <86v8ieb2g7.fsf@mail.linkov.net> <868rdokw73.fsf@mail.linkov.net> From: martin rudalics In-Reply-To: <868rdokw73.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:Z04QnEyUM43gPjp5BxxJ4t2CzEVtNhzkBBnmGt3eK7dsnz8ftxo 9qlEy5oc01cfe+fDSA1qsWA+Zl+Dl5p5Z//Bsr35U5JX1gXiyus4SBozxDLyxiuNPQr8zIX cF6uiiv+0xSy8MBftm/suWtCNnsg2quka0DldwQNQQrP0PqbgktD7cz4juGlg5894+PqPSH MQcJmHbOYw3csUIK2sEjA== X-Spam-Flag: NO 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+zvV4RX1twsjWjZ B8IDM969lMybamN3CBMTKAeMNosSzM02V9++ZVtJ22Q9lf2dwoLDOrltJx/TagWxJZ/FHSYSe Hz6pLuvZh/s9dGEONyR7/tbDaDWlib/q7NbfbZDRIQXsoa//2AQgCKsPUeMFVjcqrNS9ToDh3 oaXQiA== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>> 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 From debbugs-submit-bounces@debbugs.gnu.org Wed May 17 13:19:58 2023 Received: (at 62592) by debbugs.gnu.org; 17 May 2023 17:19:58 +0000 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 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 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 6910E1BF206; Wed, 17 May 2023 17:19:48 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <5bfecd56-e3ac-0d95-88f0-7a49980205eb@gmx.at> (martin rudalics's message of "Wed, 17 May 2023 09:07:21 +0200") Organization: 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> Date: Wed, 17 May 2023 19:46:31 +0300 Message-ID: <86sfbulwfc.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >>>>> 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) From debbugs-submit-bounces@debbugs.gnu.org Thu May 18 04:30:20 2023 Received: (at 62592) by debbugs.gnu.org; 18 May 2023 08:30:20 +0000 Received: from localhost ([127.0.0.1]:51944 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzZ1g-0002KF-F1 for submit@debbugs.gnu.org; Thu, 18 May 2023 04:30:20 -0400 Received: from mout.gmx.net ([212.227.17.22]:33217) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzZ1f-0002Jy-AJ for 62592@debbugs.gnu.org; Thu, 18 May 2023 04:30:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1684398613; i=rudalics@gmx.at; bh=yyXxa1Olh26ENnShEyhR2zBi63d/zqq9vzWEpeEdC6I=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=RN1GRXwnNXp9nyph+bwvXMGLH3lP3RWkSKomFGIm51Fsg4WU64z806tzHnjrzHJ8H LM7MsPCzrl+j9T8QzcuFpkGDPPr8EF/lQsrLwG0UqwC8deImI9UHIGGi4PUE6YJTtR Rz26OnntvSRy0y2ily+h0PFzaxD/Scgg8XQmFc4eT13RPi01EwL188jlDJP6rqJye8 Yh0k2je1EyYC7KHr5J8hO62/kYnH/t+R1XoaZpc8UwISXvoSPzFcd4otRu758y+ByJ C2oibfxHE92RyJPg2+f2qRE9TAHyyrzb94L+QHv1HFvviG4eqKMKMLjXZLPEkshZP6 yk+OPbHMMTcoA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.100] ([213.142.97.161]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MD9T7-1pqSM018nh-00958i; Thu, 18 May 2023 10:30:13 +0200 Message-ID: <493d0d56-2041-81cf-279e-6d6128b366e7@gmx.at> Date: Thu, 18 May 2023 10:30:12 +0200 MIME-Version: 1.0 Subject: Re: bug#62592: Not creating new Tabs with small window Content-Language: en-US To: Juri Linkov 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> <86sfbulwfc.fsf@mail.linkov.net> From: martin rudalics In-Reply-To: <86sfbulwfc.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:h1CnLDlj0Xdk64v1ipziR6F3sXluH8wL2IEUeqz/hts2cLwrnPe ixtKUIBp+CP+cAu6mkDlD6OaZODsV25TZHSrAfd0AfG04IGpKfjIrJaRWKZkdjqPimwVzik gHuxZ8PZ9tEMyMXeVampdqcG9Dytqz9ZH+TccyL+AoS0+wTKk5BCWJbMnqZAdwijghommo2 ppNqYPhLct+joDcHym19g== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:6QvXgPAbgNs=;k0SgnjisoqwkPY2z5fROqHh5onE eZ32bU8Np3xC1DKm50IUCPUbTWEgVGLPRVpYkJiNdJd/IXWHa4GDAAyYAch1GPVMROIXKYTPX AKXbxxmV9BSqB06zgUI6RaH6zV2kqHsq4F0ZraGtIRuQARLVJnU0GXfOYvjbckagDoKyikp+k wRwd0DjJRfiSLVgfoKXR+5lIbNivkS5PnF8q3aJFb05vp7tENvKdJ3/ZYcYhMzqobYtT8Klue ruF2oV9EizQ8gKhaqXlHr4y5ihethCeoZ6Qe1hHdUU+OiHq47i3o+sLW/vTH8YtI8My7LYwgO o0nk9TCIfVQHWDym3uJbqYNrq0QqddWDkguYzF2ePv0oG5kTVpK3I1rF3ACBI7PPu4xbWkQct rnINQtec5E7MUCXk2J+autjdBPSMgDHcmfpXcmUr0qhYjP++xSgHKFYjQ2cAUy6VNn7FRDmUD B4+DBkjDq5T2jVSTT/c1nSlbbTpvpIXV3pi2BxkSdakGdm4y8zNn30e9Nd9fyaQxzR7uFlzqs OJ6KTiwPMOO/eU+BaNPb2ZyhDxHGEEkHoLGBUMaQE0v5AQYMWbJ6XlZEfcOV98nyhpcfSm3BY j6uQCQ/Z6UviaH5nYG12SFNFOwlcmgWrdJaPunwpbtaRDIB7QNguxHDFzZoGNpnPPljFNcFCG a1b6nen1YmXjpDzYTqiOS8DjsSJpBjPJyECGQXBArZbiu1/ETzkiEf5ilE7PLnCdGJZzcL5D6 EBKBdDN1zddZEC9kdKLTDVrE+lCLSfmES6rTUJ2dfsa7zmJ0+XBIRISjrjlPXsAVbNkyleVCF +ZGcXruNB6XRaAvmlF2k9CMOWLAtcX7Zp8D6g17Omi68KjklN2yBAIsqaaJIcyivwGr8O2H66 Z9s9IanFR9WpZUiGNpLmdz+ZgUak71ld1BVpA0SUPGkqPdsjOOitCym6fn3WIKFolHltP/Z41 Ct8kEsrN1WgkgME7vgGfp+0AS3E= X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Thanks for the suggestion. Empirically I found that > '(split-window-horizontally 1)' always fails. > So the next patch uses '(split-window-horizontally 2)'. 1 is less than 'window-safe-min-width' (the doc-string of 'split-window' says in this regard that "this function can make a new window as small as one line or two columns"). And are you sure you want to copy the 'quit-restore' parameter? As a rule, in Lisp code never use the -vertically/-horizontally postfixed forms of 'split-window' unless you want to mock their interactive behavior. >> 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'? Funny - here I use that for a window that can shadow an existing window for redisplay purposes. If you want the selected window to change identity, you should say that in a comment. martin From debbugs-submit-bounces@debbugs.gnu.org Thu May 18 12:01:28 2023 Received: (at 62592) by debbugs.gnu.org; 18 May 2023 16:01:28 +0000 Received: from localhost ([127.0.0.1]:54255 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzg4G-00074S-FT for submit@debbugs.gnu.org; Thu, 18 May 2023 12:01:28 -0400 Received: from relay5-d.mail.gandi.net ([217.70.183.197]:54363) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzg4B-00073s-IW for 62592@debbugs.gnu.org; Thu, 18 May 2023 12:01:27 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9BBB71C0008; Thu, 18 May 2023 16:01:16 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <493d0d56-2041-81cf-279e-6d6128b366e7@gmx.at> (martin rudalics's message of "Thu, 18 May 2023 10:30:12 +0200") Organization: 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> <86sfbulwfc.fsf@mail.linkov.net> <493d0d56-2041-81cf-279e-6d6128b366e7@gmx.at> Date: Thu, 18 May 2023 18:50:29 +0300 Message-ID: <861qjd3agq.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) >> Thanks for the suggestion. Empirically I found that >> '(split-window-horizontally 1)' always fails. >> So the next patch uses '(split-window-horizontally 2)'. > > 1 is less than 'window-safe-min-width' (the doc-string of 'split-window' > says in this regard that "this function can make a new window as small > as one line or two columns"). And are you sure you want to copy the > 'quit-restore' parameter? As a rule, in Lisp code never use the > -vertically/-horizontally postfixed forms of 'split-window' unless you > want to mock their interactive behavior. Then the following patch seems the right way to implement this. >>> 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'? > > Funny - here I use that for a window that can shadow an existing window > for redisplay purposes. If you want the selected window to change > identity, you should say that in a comment. Actually, there are 2 cases: 1. when 'tab-bar-new-tab-choice' is not equal to 'window' then need to remove all old window parameters and create a new window, this is what split-window/delete-window do; 2. when 'tab-bar-new-tab-choice' is 'window', then need to create a new identity that keeps all window parameters, this is done by: (window-state-put (window-state-get)) And comments are trying to explain this. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 9d703b5d048..aae80b28047 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1585,7 +1585,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)))) + (split-window nil window-safe-min-width t) + (delete-window)))) (let ((buffer (if (and (functionp tab-bar-new-tab-choice) diff --git a/lisp/window.el b/lisp/window.el index aa7520f30fa..ab7dd5ced12 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 window window-safe-min-width t) (delete-window window))))) (set-window-dedicated-p window nil) From debbugs-submit-bounces@debbugs.gnu.org Fri May 19 03:31:21 2023 Received: (at 62592) by debbugs.gnu.org; 19 May 2023 07:31:21 +0000 Received: from localhost ([127.0.0.1]:55315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzua8-0004eM-QB for submit@debbugs.gnu.org; Fri, 19 May 2023 03:31:21 -0400 Received: from mout.gmx.net ([212.227.17.22]:55747) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pzua6-0004dw-QJ for 62592@debbugs.gnu.org; Fri, 19 May 2023 03:31:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1684481472; i=rudalics@gmx.at; bh=KgS+Ez7MUyd9BniY67wwhNuEAHU+oAI4oo3FWLrkXIU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=dOHifIjpzhSNmvTAggt3GQHUe1e+DcZmnOI8CBmEWHJJeJEUqt8YNXrmzrqnqinno EM2XSm14FRlDCOuUNrYqyh+otHMV5BDkH7QS/oH5c/HHqc3PryF324PGcpkewXJrYK C0iV2OmayyBFxK//FAE2XQRdTqmFLvk788zIDOSjfmRWw5K5Q9OXwWqb2NNMdtrUR1 /3ZQtlVNJ2qCWyfLvWMrkOK7QMnXyxznp2c0owJv1UtruzCLCpUulkySt9/NTpkAed 9YrpTuGwX89KrKIuXbEektEqXh5kxlK4j2tCwHOv7ry0CD3ELb4sHdGGBM+4T4AQHD z5HvCTMGQVrqA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.1.100] ([46.125.249.114]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N8XPt-1qD1Un3HeL-014VVU; Fri, 19 May 2023 09:31:12 +0200 Message-ID: <9276b7b2-8246-1eca-e4f3-71ae6ed89b85@gmx.at> Date: Fri, 19 May 2023 09:31:12 +0200 MIME-Version: 1.0 Subject: Re: bug#62592: Not creating new Tabs with small window Content-Language: en-US To: Juri Linkov 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> <86sfbulwfc.fsf@mail.linkov.net> <493d0d56-2041-81cf-279e-6d6128b366e7@gmx.at> <861qjd3agq.fsf@mail.linkov.net> From: martin rudalics In-Reply-To: <861qjd3agq.fsf@mail.linkov.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:LnwXyRd8haeDC8xzi9hFgDbThzwnsF+sPyS7ykbxv/2AUvxNFyp p8XO7BdofaGaDsF3Rl6nMbyXN5EaGT76FdZomaNSrbk2OOm8WFNUuMo5HoHiUod190N4UN1 RvNrUDwLOpwvW71BzTkYXL3mua7Eoy0lJAABCHBG8actYJg2NKah1XN3zogAEBXDt9N20V1 wPjDDLkeNXcjOxbrsw/BQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:o0dYezMrDQc=;syaVoVAGg1GmljVDs5VsTT7NF+M MuTnDo0E9BPnnrGLVBrVSA5BNntKmoWzbq325j/2ggPmTSZpximMNXRsyRM7ozG7d5f6xf2Gq dr+AfrGCmZKlPiVYEfbYSGEQBPd92K3UvJ6xzqbGO/JvTd+zfhRtc/22XvU8oNuuYYQCaGHlU ncEkpWWJcfXJzOFLWmusvJ7brMXhbuqXLjLjxWsP4M4R1t89rxQh05fJjbxAFEVQ28G8OvNS5 NU5EOhbtBEqJ+PCbtbtnvbx9D5bm4ch8kAGPsdXTY5h+HvGmgQ7PtyfEP6KVFtzpgbPuv5X9T njYX8SSFNI2BYX7vrUeht9KL0KSulssnvGQ5P1kgokBoXiGXCIV0c/u//YPhltPjWS4a3FdWP U12YRdvF5pMsSnEerM2OaexRsQ3jNUQutFQtiLhhz/wVPvGjRtW5nrYxDvTJdtwcCvIjLjZ0B qavWLxBEBTiJtHzF06O96+CFTrTtkRHeSI13JemrbGpOoqtm/o6PSvrZx+K/Zrc0PF8hFDpJe hF18rDEGPFNZWqa3wbZ3rPqcDd0d9m2pUm1vQsZoOZfAf9wV62VLCCRLtHRLiTAuB6YHh/4Ef PqXR9zSGxt/VOUW5ffC41tK5Tg2FrF20sdzf1cVUxgZWZPFtpU4EPMboJEnhK6h2m9M4Slu+m VAYZrHOjVO6Ewq4qZ9I4t9ZDPJa1i/KTkjbVJEne7FIm7UKbBBtP3IF4xzqUdNvXfa7xuzhYf ZU4rmh7URH+9RKnKWt4Z4/XuxdcliX5rKibtuFS/3lOwbijOez29oX6Jf38PYZsaKC/1bFlUO IOALT0RoI9mc/dFBtxGWpmUyFISLun4OSYK9gpOZWtuTssHvO11eVwa+a52Rl8GAmto+eX688 tCjRh9JFeGVMD7hn4RPNhPM/iwsDXWjsV6ug8a6kueq6SxOKlxOxwOPilLnhC0eMMZWqu732O 8lj/6Q== X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) > Then the following patch seems the right way to implement this. LGTM martin From debbugs-submit-bounces@debbugs.gnu.org Fri May 19 14:16:47 2023 Received: (at 62592) by debbugs.gnu.org; 19 May 2023 18:16:47 +0000 Received: from localhost ([127.0.0.1]:57370 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q04ek-0008OO-Vr for submit@debbugs.gnu.org; Fri, 19 May 2023 14:16:47 -0400 Received: from relay4-d.mail.gandi.net ([217.70.183.196]:47345) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1q04ej-0008Ns-AH; Fri, 19 May 2023 14:16:45 -0400 Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 22969E0006; Fri, 19 May 2023 18:16:37 +0000 (UTC) From: Juri Linkov To: martin rudalics Subject: Re: bug#62592: Not creating new Tabs with small window In-Reply-To: <9276b7b2-8246-1eca-e4f3-71ae6ed89b85@gmx.at> (martin rudalics's message of "Fri, 19 May 2023 09:31:12 +0200") Organization: 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> <86sfbulwfc.fsf@mail.linkov.net> <493d0d56-2041-81cf-279e-6d6128b366e7@gmx.at> <861qjd3agq.fsf@mail.linkov.net> <9276b7b2-8246-1eca-e4f3-71ae6ed89b85@gmx.at> Date: Fri, 19 May 2023 21:04:58 +0300 Message-ID: <86wn149oz9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/30.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 62592 Cc: 62592@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) close 62592 29.0.60 thanks >> Then the following patch seems the right way to implement this. > > LGTM So now pushed to emacs-29, and closed. From unknown Wed Jun 18 23:05:39 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 17 Jun 2023 11:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator