* lisp/tab-bar.el (tab-bar-show-inactive-group-tabs): New defcustom.
(tab-bar-format-tabs-groups): Use it (bug#71939). Suggested by Ship Mints <shipmints@gmail.com>.
This commit is contained in:
parent
9bf0331d02
commit
63e609f6aa
1 changed files with 22 additions and 3 deletions
|
@ -1064,6 +1064,16 @@ when the tab is current. Return the result as a keymap."
|
|||
(tab-bar-select-tab ,i))))
|
||||
:help "Click to visit group"))))
|
||||
|
||||
(defcustom tab-bar-show-inactive-group-tabs nil
|
||||
"Show tabs even if they 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 "31.1")
|
||||
|
||||
(defun tab-bar-format-tabs-groups ()
|
||||
"Produce tabs for the tab bar grouped according to their groups."
|
||||
(let* ((tabs (funcall tab-bar-tabs-function))
|
||||
|
@ -1080,7 +1090,8 @@ when the tab is current. Return the result as a keymap."
|
|||
((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)
|
||||
(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
|
||||
|
@ -1088,9 +1099,17 @@ when the tab is current. Return the result as a keymap."
|
|||
(tab-bar--format-tab tab i))))
|
||||
;; Show first tab of other groups with a group name
|
||||
((not (equal previous-group tab-group))
|
||||
(tab-bar--format-tab-group tab i))
|
||||
(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 nil))
|
||||
(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)))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue