GNU bug report logs - #45556
27.1; Unexpected behavior of `tab-bar-show' variable

Previous Next

Package: emacs;

Reported by: Marcel Ventosa <mve1 <at> runbox.com>

Date: Wed, 30 Dec 2020 17:37:02 UTC

Severity: normal

Tags: fixed

Found in version 27.1

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 45556 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Marcel Ventosa <mve1 <at> runbox.com>
Cc: 45556 <at> debbugs.gnu.org
Subject: Re: bug#45556: 27.1; Unexpected behavior of `tab-bar-show' variable
Date: Tue, 05 Jan 2021 20:43:48 +0200
> (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)




This bug report was last modified 4 years and 131 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.