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.devel Subject: Re: tab-bar: Making a new tab without no-delete-other-windows windows Date: Fri, 24 Sep 2021 09:50:07 +0300 Organization: LINKOV.NET Message-ID: <878rzmo4bk.fsf@mail.linkov.net> References: <87y27mbhvk.fsf@alphapapa.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18677"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: emacs-devel@gnu.org To: Adam Porter Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Sep 24 08:53:08 2021 Return-path: Envelope-to: ged-emacs-devel@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 1mTf51-0004ez-W4 for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 08:53:07 +0200 Original-Received: from localhost ([::1]:60838 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mTf50-0004H9-EQ for ged-emacs-devel@m.gmane-mx.org; Fri, 24 Sep 2021 02:53:06 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33420) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTf30-0001Dd-To for emacs-devel@gnu.org; Fri, 24 Sep 2021 02:51:02 -0400 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54431) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mTf2z-0004Qp-1D for emacs-devel@gnu.org; Fri, 24 Sep 2021 02:51:02 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id A713660005; Fri, 24 Sep 2021 06:50:57 +0000 (UTC) In-Reply-To: <87y27mbhvk.fsf@alphapapa.net> (Adam Porter's message of "Fri, 24 Sep 2021 01:35:43 -0500") Received-SPF: pass client-ip=217.70.183.195; envelope-from=juri@linkov.net; helo=relay3-d.mail.gandi.net 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:275385 Archived-At: > I've been experimenting with tab-bar, and I noticed that, when I make a > new tab, e.g. with "C-x t 2", any windows that have the > no-delete-other-windows parameter set are displayed in the new tab. > > I guess sometimes that might be what's desired, e.g. when using a side > window that the user wants to be displayed regardless of window > configuration. But in my case, I have some side windows in a tab that > are only relevant to that tab's purpose, and when I make a new tab, I > don't want those side windows to be included in it. As it is, I have to > "C-x 0" on each unwanted window after making the new tab, which is > awkward. > > So I added this to my config, which seems to solve it for me: > > (use-package tab-bar > :config > (defun ap/really-delete-other-windows (&rest _ignore) > (let ((ignore-window-parameters t)) > (delete-other-windows))) > (cl-pushnew #'ap/really-delete-other-windows > tab-bar-tab-post-open-functions)) > > I wonder, would it be worth including something like this by default, or > as a "batteries-included" choice in the customization option? If this works for you, then maybe we need to include the same fix by default? ``` diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 69eb3a3608..55a19db8bb 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -1245,7 +1245,8 @@ 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))) - (delete-other-windows) + (let ((ignore-window-parameters t)) + (delete-other-windows)) ;; Create a new window to get rid of old window parameters ;; (e.g. prev/next buffers) of old window. (split-window) (delete-window) ```