From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Benson Chu Newsgroups: gmane.emacs.bugs Subject: bug#62427: tab-bar-new-tab-to now handles cases with multiple side-windows Date: Fri, 14 Apr 2023 22:03:34 -0500 Message-ID: <87r0slbzqp.fsf@fastmail.com> References: <875yapvoxh.fsf@fastmail.com> <86jzz4mynj.fsf@mail.linkov.net> <83cz4wb0vz.fsf@gnu.org> <865yamhdx7.fsf@mail.linkov.net> <83cz4u9uz1.fsf@gnu.org> <86jzz2f8si.fsf@mail.linkov.net> <83sfdq86pi.fsf@gnu.org> <835yal82ta.fsf@gnu.org> <86a5zuw5oo.fsf@mail.linkov.net> <87cz4oq485.fsf@fastmail.com> <86pm8nfoja.fsf@mail.linkov.net> <867cuukuvj.fsf@mail.linkov.net> <86lejajex8.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="5592"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.8.14; emacs 29.0.90 Cc: Eli Zaretskii , 62427@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 15 05:18: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 1pnWQh-0001Ek-A3 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 15 Apr 2023 05:18:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnWQP-0002Ou-L1; Fri, 14 Apr 2023 23:18: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 1pnWQN-0002OO-G7 for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 23:18: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 1pnWQM-0005qK-T9 for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 23:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pnWQM-0005LU-6G for bug-gnu-emacs@gnu.org; Fri, 14 Apr 2023 23:18:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Benson Chu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 15 Apr 2023 03:18:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62427 X-GNU-PR-Package: emacs Original-Received: via spool by 62427-submit@debbugs.gnu.org id=B62427.168152866720528 (code B ref 62427); Sat, 15 Apr 2023 03:18:02 +0000 Original-Received: (at 62427) by debbugs.gnu.org; 15 Apr 2023 03:17:47 +0000 Original-Received: from localhost ([127.0.0.1]:48003 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnWQ6-0005L2-Vf for submit@debbugs.gnu.org; Fri, 14 Apr 2023 23:17:47 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:34461) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pnWQ5-0005Kn-1J for 62427@debbugs.gnu.org; Fri, 14 Apr 2023 23:17:45 -0400 Original-Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id B1D3F5C01C7; Fri, 14 Apr 2023 23:17:39 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Fri, 14 Apr 2023 23:17:39 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1681528659; x=1681615059; bh=c9 r3kHLkjqifB4arh7/++6V6xKOPGnKpqeV1vxP7I/A=; b=uCnOu7YPWPz4EKa3m8 1OCwq/uCXpLN1sa191BhvaFmR1c0ClwR4hjV5/bZLQdK1Skmj3AApzRwgULCuK9b HljnIiAGQMGWFHS680YKhU//iBHm3OsdDCIKbn0oykLpe+y5x+NrpUFmkqE3hKOF AP1xshDiHyCcK/JtqNv8V/X8pPSYBeapekL3/sqQyAlMVRy0gmbM5Q6Bo+pD4N8x sRcDO/Cau0chA9HghIKXu+/2DpAbIqxAjUnpTbEiBLFT2pGNamv57lMmtZm02G65 lZ3Wn7MpGbb0xjoDbpMTaGW2kebHxivjcT60BH1Lex3a4g8bVfcJt3m8HkhqDhpG iUcg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681528659; x=1681615059; bh=c9r3kHLkjqifB 4arh7/++6V6xKOPGnKpqeV1vxP7I/A=; b=S8X5Pk7YLj1TglXrAStX8rTKe966H YfJdoRSFZ1FZibOYdQeblqdoMkq5akc+7WanBf8CWApwUlUsOSTmar8es6wr+2bS LfX8o8MeFSeDnjT4M/Bh8yxdGqu7J24DLcrdwzwbCzxwWlk/zN+YU+aGuEy4fhoR vSb+/pV/n7Xv/mwIy/i7sFGMf3/pVC5MvXBU6Jc89XhfwCGcFRiFRK1XWCW41IWG e3qrynbMMITMAFyWatPh5atsvFaQzv0bn3DCvghwnnegkdXWOWnEzH4vJLiczkdb d8dDjyOSJQWX+ZNmSFyNd4ucEaXLczVrW0Lqn6hede/LgWn+g1TtROozw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeluddgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfhgfhffvvefuffgjkfggtgesmhdtreertdertdenucfhrhhomhepuegvnhhs ohhnucevhhhuuceosggvnhhsohhntghhuhegheejsehfrghsthhmrghilhdrtghomheqne cuggftrfgrthhtvghrnhephfeuudekvdeggefhfeeiheehudduleejudeiudfhtefhtdff tdelheeljeegfefgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilh hfrhhomhepsggvnhhsohhntghhuhegheejsehfrghsthhmrghilhdrtghomh X-ME-Proxy: Feedback-ID: id5c9466e:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 14 Apr 2023 23:17:38 -0400 (EDT) In-reply-to: <86lejajex8.fsf@mail.linkov.net> 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:259992 Archived-At: --=-=-= Content-Type: text/plain I've done some digging into whether we can mimic OR use display-buffer when creating a new tab, and while we could do this, we also advertise two other behaviors for tab-bar-new-tab-choice that would make the function needlessly complex, as use/mimicry of display-buffer would only help in the case of when tab-bar-new-tab-choice is t. On a side-note (side-window? haha), I've got a patch that side-steps (hehe) the issue of modifying the 'window-side parameter completely, by binding to window--sides-inhibit-check to t. Having bound this, the issues wrt split-window and delete-other-windows is no longer present, and thus we no longer have to touch the 'window-side parameter at all. The same can't be said for the 'window-atom parameter (there's no variable to bind to ignore checks), so it still needs to be removed in order to ensure a safe call to delete-other-windows and split-window. Would this be a better patch? It's now less destructive on existing window parameters. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-tab-bar-new-tab-inhibit-side-window-checks.patch >From 2eaeea1f815b5e6c75947e9373c1b2f8fc539344 Mon Sep 17 00:00:00 2001 From: Benson Chu Date: Fri, 24 Mar 2023 15:38:03 -0500 Subject: [PATCH] ; tab-bar-new-tab inhibit side-window checks ; Previously, calling tab-bar-new-tab-to only removes the 'window-side ; property on the currently selected window, and then a call to ; delete-other-windows was made to ensure that the selected window was ; the only window. We can skip this check by shadowing ; window--sides-inhibit-check to t. * lisp/tab-bar.el (tab-bar-new-tab-to): inhibit side-window checks Copyright-paperwork-exempt: yes --- lisp/tab-bar.el | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index dce6fa735fc..c7983146bf9 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1552,15 +1552,14 @@ tab-bar-new-tab-to ;; Handle the case when it's called in the active minibuffer. (when (minibuffer-selected-window) (select-window (minibuffer-selected-window))) - ;; Remove window parameters that can cause problems - ;; with `delete-other-windows' and `split-window'. - (unless (eq tab-bar-new-tab-choice 'clone) - (set-window-parameter nil 'window-atom nil) - (set-window-parameter nil 'window-side nil)) - (let ((ignore-window-parameters t)) + (let ((ignore-window-parameters t) + (window--sides-inhibit-check t)) (if (eq tab-bar-new-tab-choice 'clone) ;; Create new unique windows with the same layout (window-state-put (window-state-get)) + ;; Remove window parameters that can cause problems + ;; with `delete-other-windows' and `split-window'. + (set-window-parameter nil 'window-atom nil) (delete-other-windows) (if (eq tab-bar-new-tab-choice 'window) ;; Create new unique window from remaining window -- 2.40.0 --=-=-= Content-Type: text/plain Juri Linkov writes: >> 1. (setq debug-on-error t enable-recursive-minibuffers t) >> 2. M-: (or any other prompt like 'M-x') >> 3. Resize the minibuffer window e.g. with the mouse to at least 4 lines high >> 4. M-x windmove-swap-states-up RET >> 5. Click on the bottom window >> 6. C-x t 2 >> 7. Click on the bottom window >> 8. C-x t 2 >> >> Debugger entered--Lisp error: (error "Specified root is not an ancestor of specified win...") >> delete-other-windows-internal(# #) >> delete-other-windows() >> tab-bar-new-tab-to() >> tab-new(nil) > > Maybe the simplest fix is just not to create such a broken > window configuration: > > diff --git a/lisp/windmove.el b/lisp/windmove.el > index 06ce16c0d42..57511291588 100644 > --- a/lisp/windmove.el > +++ b/lisp/windmove.el > @@ -724,6 +724,8 @@ windmove-swap-states-in-direction > nil windmove-wrap-around 'nomini))) > (cond ((or (null other-window) (window-minibuffer-p other-window)) > (user-error "No window %s from selected window" dir)) > + ((window-minibuffer-p (selected-window)) > + (user-error "Selected window is the minibuffer")) > (t > (window-swap-states nil other-window))))) --=-=-=--