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, 24 Mar 2023 16:07:22 -0500 Message-ID: <875yapvoxh.fsf@fastmail.com> 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="39578"; mail-complaints-to="usenet@ciao.gmane.io" To: 62427@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Mar 24 23:06:00 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 1pfpXr-0009rD-7w for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 24 Mar 2023 23:06:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pfpT7-0003wY-Tg; Fri, 24 Mar 2023 18:01: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 1pfpT5-0003tF-CE for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01: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 1pfpT5-0000eY-3U for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 18:01:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pfoja-0008Qm-Js for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 17:14: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: Fri, 24 Mar 2023 21:14:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 62427 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.167969238432334 (code B ref -1); Fri, 24 Mar 2023 21:14:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 24 Mar 2023 21:13:04 +0000 Original-Received: from localhost ([127.0.0.1]:41507 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfoie-0008PR-7b for submit@debbugs.gnu.org; Fri, 24 Mar 2023 17:13:04 -0400 Original-Received: from [209.51.188.17] (port=48440 helo=lists.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pfodO-0008Eg-TC for submit@debbugs.gnu.org; Fri, 24 Mar 2023 17:07:39 -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 1pfodF-00047q-TN for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 17:07:29 -0400 Original-Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pfodD-0005G1-HR for bug-gnu-emacs@gnu.org; Fri, 24 Mar 2023 17:07:29 -0400 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D1DA23200951 for ; Fri, 24 Mar 2023 17:07:23 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Fri, 24 Mar 2023 17:07:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :message-id:mime-version:reply-to:sender:subject:subject:to:to; s=fm2; t=1679692043; x=1679778443; bh=Ly4i2UbH8LGttjlh6ZLuiaJBM ghkRh7XTR2M8FhAtQc=; b=Qr27Yy1pqM72gG3RNv9JeaOStEGEKkDNzd2WL8qKA 5JioHDx5Er+XwQItbWEVkprVxavhphdq023A8WtoAvW46hk7aHeridGQC4jx23pB digwO7P5ccFycb3lISbdk8mB0948W7+7KBXB7PQPfv4oKT+tyIZ3wRO+SUvLmz6N 8pr6qCfi9lH5R1UDd4Tfuq5InqCtSMfGTZ+7pR77lYI37WgaXh0OKeM1glDnlKQY TFBM0Tq+93pS+bdqV8PUgNOVcRfyFrrSiAkAxCBYdRTyLM5PRDafaBtDvPiWmAk3 cLmnRLGmHDOQo7zQDpL115+LY7N5pAkzlLQRB8+/RUigQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:message-id :mime-version:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1679692043; x=1679778443; bh=Ly4i2UbH8LGttjlh6ZLuiaJBMghkRh7XTR2 M8FhAtQc=; b=N9B/4lczQNDTMolTkmnmLDZeyF2I7MRSn+jEkNi5bGrrwoxXByy 1lD++wbSR/lEePr3IMp5wGVnRsY9hCbL0m0xaBX+7U7N8RXmW9cxIn7aRTWNHdOM UfIZ1FHvTwIapmz/hdCK7CMKcA5MXmasPmMKXbhOxB661tvCXMw2Af49gb26yKRs k4WKAC/rvIppVF2C8JqidMeF2vfl2KLJnOS5yym7UVp5VJruWc5yWEAsDtTd25Mi hT9MPmy+vCujxBIAbx3S6VIY/qZ8n0hxLNkkiqJpLEr4fYc09PyHVZFFM9G0wF6U aEao+z8mZ9oXc1tiLWJQrpBq7Sj4hobbTGw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegiedgudegjecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhephffvufffkfggtgesmhdtreertd dttdenucfhrhhomhepuegvnhhsohhnucevhhhuuceosggvnhhsohhntghhuhegheejsehf rghsthhmrghilhdrtghomheqnecuggftrfgrthhtvghrnhepkeettdejieejueegvdekhf dtuedtkefhfffghedtuddvvedvudduiedutefghfeinecuvehluhhsthgvrhfuihiivgep tdenucfrrghrrghmpehmrghilhhfrhhomhepsggvnhhsohhntghhuhegheejsehfrghsth hmrghilhdrtghomh X-ME-Proxy: Feedback-ID: id5c9466e:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA for ; Fri, 24 Mar 2023 17:07:23 -0400 (EDT) Received-SPF: pass client-ip=64.147.123.25; envelope-from=bensonchu457@fastmail.com; helo=wout2-smtp.messagingengine.com X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 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_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 24 Mar 2023 17:13:02 -0400 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:258531 Archived-At: --=-=-= Content-Type: text/plain Hello, I've noticed that when I call #'tab-bar-new-tab while I'm in a side-window that has siblings, I get an error from #'window--sides-check, which happens when #'tab-bar-new-tab calls #'delete-other-windows. Here's an example of my problem: (progn (display-buffer-in-side-window (get-buffer-create "*hello*") '((side . right) (slot . 1))) (select-window (display-buffer-in-side-window (get-buffer-create "*world*") '((side . right) (slot . 2)))) (tab-bar-new-tab)) The attached patch fixes this issue. Could it be applied to the emacs-29 branch? Thanks! --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-tab-bar-new-tab-to-now-handles-cases-with-multiple-s.patch >From cc8974b45d5726a0f6a8d9ab6566411c118a0769 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-to now handles cases with multiple side-windows 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. However, if there are other side-windows (with the same side) present, the call to delete-other-windows will fail on the window--sides-check. This is because according to the check, all windows on the same side should have the same 'window-side, and because we only removed the 'window-side parameters on one of the windows, there will be inconsistencies with that window and its parent and siblings. Because of this, the call to delete-other-windows to fail. This patch makes sure that all windows on a given side will have 'window-side set to nil, so that the call to delete-other-windows will not fail. * lisp/tab-bar.el: remove 'window-side from selected window, window's parent, and all window's siblings. --- lisp/tab-bar.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index dce6fa735fc..f05abffbcdb 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1556,7 +1556,13 @@ tab-bar-new-tab-to ;; 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 ((side (window-parameter nil 'window-side))) + (when side + (walk-window-tree + (lambda (window) + (when (eq side (window-parameter window 'window-side)) + (set-window-parameter window 'window-side nil))) + nil t)))) (let ((ignore-window-parameters t)) (if (eq tab-bar-new-tab-choice 'clone) ;; Create new unique windows with the same layout -- 2.40.0 --=-=-=--