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#46299: 28.0.50; Value of tab-bar-show not respected in new frames. Date: Fri, 05 Feb 2021 10:54:03 +0200 Organization: LINKOV.NET Message-ID: <87k0rmnbqs.fsf@mail.linkov.net> References: <871rdv4xog.fsf@gmail.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="31391"; 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: 46299@debbugs.gnu.org To: Bastian Beischer Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Feb 05 10:27:06 2021 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 1l7xOM-00084S-Sg for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 10:27:06 +0100 Original-Received: from localhost ([::1]:44758 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l7xOL-0002XN-Um for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 05 Feb 2021 04:27:05 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:35230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l7xKQ-00065x-7V for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 04:23:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59492) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l7xKP-00015V-Vj for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 04:23:01 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1l7xKP-0003rG-QD for bug-gnu-emacs@gnu.org; Fri, 05 Feb 2021 04:23:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 05 Feb 2021 09:23:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 46299 X-GNU-PR-Package: emacs Original-Received: via spool by 46299-submit@debbugs.gnu.org id=B46299.161251695614767 (code B ref 46299); Fri, 05 Feb 2021 09:23:01 +0000 Original-Received: (at 46299) by debbugs.gnu.org; 5 Feb 2021 09:22:36 +0000 Original-Received: from localhost ([127.0.0.1]:42800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7xJz-0003q6-QF for submit@debbugs.gnu.org; Fri, 05 Feb 2021 04:22:36 -0500 Original-Received: from relay3-d.mail.gandi.net ([217.70.183.195]:44503) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1l7xJv-0003pd-My for 46299@debbugs.gnu.org; Fri, 05 Feb 2021 04:22:34 -0500 X-Originating-IP: 91.129.108.204 Original-Received: from mail.gandi.net (m91-129-108-204.cust.tele2.ee [91.129.108.204]) (Authenticated sender: juri@linkov.net) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id 255AC60012; Fri, 5 Feb 2021 09:22:23 +0000 (UTC) In-Reply-To: <871rdv4xog.fsf@gmail.com> (Bastian Beischer's message of "Thu, 04 Feb 2021 17:14:55 +0100") 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" Xref: news.gmane.io gmane.emacs.bugs:199347 Archived-At: --=-=-= Content-Type: text/plain > I noticed that with the latest master branch setting tab-bar-show > to "1" does not work work for new frames. On those the tabs are shown > even if tab-bar-show is set to 1. Thanks for finding a case that is still unhandled. > I suppose a hook is needed which applies the correct setting > to the new frame? Generally, Emacs core packages should avoid adding own code to hooks, because hooks are intended mostly for users, such as for example, configuring to enable tab-bar selectively: (add-hook 'after-make-frame-functions 'toggle-frame-tab-bar) Fortunately, frames provide a better way to set their default values with default-frame-alist, that tab-bar-mode already modifies. So doing something similar fixes the problem: --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=tab-bar-show-default-frame-alist.patch diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 6720d82b47..0cf74a7833 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -252,6 +252,12 @@ tab-bar-show (set-default sym val) ;; Preload button images (tab-bar-mode 1) + ;; New frames have only one tab, so hide it by default + (when (eq val 1) + (setq default-frame-alist + (cons (cons 'tab-bar-lines 0) + (assq-delete-all 'tab-bar-lines + default-frame-alist)))) ;; Then handle each frame individually (dolist (frame (frame-list)) (set-frame-parameter --=-=-=--