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#45556: 27.1; Unexpected behavior of `tab-bar-show' variable Date: Tue, 05 Jan 2021 20:43:48 +0200 Organization: LINKOV.NET Message-ID: <87zh1njkbf.fsf@mail.linkov.net> References: <20201230214419.1eca9494@argon> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35789"; 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: 45556@debbugs.gnu.org To: Marcel Ventosa Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jan 05 19:46:12 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 1kwrLQ-0009BO-AI for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jan 2021 19:46:12 +0100 Original-Received: from localhost ([::1]:59478 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwrLO-00027o-TY for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jan 2021 13:46:10 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59914) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwrLG-00027N-Eo for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 13:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:59382) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwrLG-0008Ic-6C for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 13:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kwrLG-00022k-3f for bug-gnu-emacs@gnu.org; Tue, 05 Jan 2021 13:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Jan 2021 18:46:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45556 X-GNU-PR-Package: emacs Original-Received: via spool by 45556-submit@debbugs.gnu.org id=B45556.16098723436774 (code B ref 45556); Tue, 05 Jan 2021 18:46:02 +0000 Original-Received: (at 45556) by debbugs.gnu.org; 5 Jan 2021 18:45:43 +0000 Original-Received: from localhost ([127.0.0.1]:42695 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwrKx-0001ku-2P for submit@debbugs.gnu.org; Tue, 05 Jan 2021 13:45:43 -0500 Original-Received: from relay9-d.mail.gandi.net ([217.70.183.199]:39817) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwrKv-0001dL-5m for 45556@debbugs.gnu.org; Tue, 05 Jan 2021 13:45:41 -0500 X-Originating-IP: 91.129.98.64 Original-Received: from mail.gandi.net (m91-129-98-64.cust.tele2.ee [91.129.98.64]) (Authenticated sender: juri@linkov.net) by relay9-d.mail.gandi.net (Postfix) with ESMTPSA id A6658FF805; Tue, 5 Jan 2021 18:45:33 +0000 (UTC) In-Reply-To: <20201230214419.1eca9494@argon> (Marcel Ventosa's message of "Wed, 30 Dec 2020 21:44:19 +0700") 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:197392 Archived-At: > (tab-bar-mode) > ;; tab bar is shown on top of buffer > (setq tab-bar-show 1) > ;; no change. Maybe we need to toggle the mode to effect changes? This is expected behavior because tab-bar-show is designed to be customized using (customize-set-variable 'tab-bar-show 1) > (tab-bar-mode 0) > ;; bar disappears > (tab-bar-mode) > ;; bar still reappears with only one tab > ;; expected behavior: tab bar remains hidden because only one tab exists Actually the low-level function 'tab-bar-mode' was designed to give more freedom to override the value of 'tab-bar-show'. So you don't need to use 'tab-bar-mode' because after customizing 'tab-bar-show', the commands 'tab-bar-new-tab' and 'tab-bar-close-tab' will do the right thing as your next examples demonstrate: > (tab-bar-new-tab) > ;; two tabs exist and are visible > (tab-bar-close-tab) > ;; only one tab is left, tab bar is hidden But below again, no need to use low-level tab-bar-mode, and tab-bar-show should be changed with customize. > (tab-bar-mode) > ;; turn mode off again > (setq tab-bar-show nil) > ;; no bar should be visible if I turn tab-bar-mode on again > (tab-bar-mode) > ;; tab bar is still visible even with the variable set to nil So there are two levels: at high level you can customize 'tab-bar-show', and tab commands do the right thing. If you want more control, then you can use 'tab-bar-mode'. Or if you want to enable/disable the tab bar individually on each new frame, then you can use such configuration: (add-hook 'after-make-frame-functions 'toggle-frame-tab-bar)