GNU bug report logs - #46299
28.0.50; Value of tab-bar-show not respected in new frames.

Previous Next

Package: emacs;

Reported by: Bastian Beischer <bastian.beischer <at> gmail.com>

Date: Thu, 4 Feb 2021 16:16:02 UTC

Severity: normal

Tags: fixed

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 #71 received at 46299 <at> debbugs.gnu.org (full text, mbox):

From: Juri Linkov <juri <at> linkov.net>
To: Bastian Beranek <bastian.beischer <at> gmail.com>
Cc: martin rudalics <rudalics <at> gmx.at>, 46299 <at> debbugs.gnu.org
Subject: Re: bug#46299: 28.0.50; Value of tab-bar-show not respected in new
 frames.
Date: Wed, 10 Feb 2021 20:24:49 +0200
> Hope this is satisfactory, if not please feel free to adjust as you wish.

Thanks, please see more comments:

> +(defun tab-bar--tab-bar-lines-for-frame (frame)
> +  (if (not tab-bar-mode)
> +      0
> +    (cond
> +     ((eq tab-bar-show t) 1)
> +     ((natnump tab-bar-show)
> +      (if (> (length (funcall tab-bar-tabs-function frame)) tab-bar-show) 1 0))
> +     (t 0))))

A small optimization:

  ((not tab-bar-mode) 0)

could be added as the first condition of the same 'cond'.

>    :set (lambda (sym val)
>           (set-default sym val)
>           ;; Preload button images
> +         ;; Note: tab-bar-mode updates tab-bar-lines as well.
> +         (tab-bar-mode 1))

Not sure whether the users would want to enable tab-bar-mode
unconditionally after customizing tab-bar-show.

Maybe when customized tab-bar-show to nil, only call
tab-bar--update-tab-bar-lines in all frames?
Or maybe simply to disable the tab bar with (tab-bar-mode 0)
when customized to nil?

> @@ -852,16 +867,15 @@ After the tab is created, the hooks in
> +    ;; Switch on tab-bar-mode, since a tab was created
> +    (when tab-bar-show
>        (tab-bar-mode 1))
> +
> +    ;; Recalculate tab-bar-lines and update frames
> +    (tab-bar--update-tab-bar-lines (selected-frame))
> +    (when tab-bar-mode
> +      (tab-bar--load-buttons)
> +      (tab-bar--define-keys))

Would you agree that here in tab-bar-new-tab-to, the first call of
tab-bar-mode should already do all these calls: tab-bar--update-tab-bar-lines,
tab-bar--load-buttons, tab-bar--define-keys?  So maybe it should be
sufficient just to leave these 2 lines here:

    (when tab-bar-show
       (tab-bar-mode 1))




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

Previous Next


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