GNU bug report logs -
#71939
tab-bar `tab-bar-show-inactive-group-tabs' feature request
Previous Next
Reported by: Ship Mints <shipmints <at> gmail.com>
Date: Thu, 4 Jul 2024 13:43:01 UTC
Severity: wishlist
Fixed in version 31.0.50
Done: Juri Linkov <juri <at> linkov.net>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
I'd like to propose that `tab-bar' allow optionally showing tabs for
inactive groups when `tab-bar-format-tabs-groups' is in force rather than
the always-on policy of collapsing inactive groups.
The proposed custom variable `tab-bar-show-inactive-group-tabs' is backward
compatible for existing users and has no visible changes for people who do
not set it to t. I will occasionally set the value locally to alter frame
by frame behavior. I've also used a key binding to toggle the behavior to
nice effect.
I've been using these changes (via advice :override) under Emacs 29.3.
Thanks, again, for this package.
The proposed implementation is below with new/changed code in bold.
*(defcustom tab-bar-show-inactive-group-tabs nil "Show tabs which are in
inactive groups." :type 'boolean :initialize 'custom-initialize-default
:set (lambda (sym val) (set-default sym val)
(force-mode-line-update)) :group 'tab-bar :version "30.x")*
(defun tab-bar-format-tabs-groups ()
"Produce tabs for the tab bar grouped according to their groups."
(let* ((tabs (funcall tab-bar-tabs-function))
(current-group (funcall tab-bar-tab-group-function
(tab-bar--current-tab-find tabs)))
(previous-group nil)
(i 0))
(mapcan
(lambda (tab)
(let ((tab-group (funcall tab-bar-tab-group-function tab)))
(setq i (1+ i))
(prog1 (cond
;; Show current group tabs and ungrouped tabs
((or (equal tab-group current-group) (not tab-group))
(append
;; Prepend current group name before first tab
(when (and (not (equal previous-group tab-group))
tab-group)
(tab-bar--format-tab-group tab i t))
;; Override default tab faces to use group faces
(let ((tab-bar-tab-face-function
tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i))))
;; Show first tab of other groups with a group name
((not (equal previous-group tab-group))
* (append (tab-bar--format-tab-group tab
i) (when tab-bar-show-inactive-group-tabs
(let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i)))))* ;; Hide
other group tabs
* (t (when tab-bar-show-inactive-group-tabs
(let ((tab-bar-tab-face-function tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i)))))* (setq
previous-group tab-group))))
tabs)))
-Stephane
[Message part 2 (text/html, inline)]
This bug report was last modified 350 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.