Skip to content

Need to display tabs correctly with tab-bar-format-tabs-groups under tab-bar-mode #107

Open
@shipmints

Description

activities needs to respect tab-bar-mode's tab-bar-tab-group-face-function override in the same way it currently respects tab-bar-tab-face-function. The lack of support means that the activities-tab face is never applied.

A PR coming shortly with the tested fix for this.

Configuration snippet for testing:

  (setq tab-bar-format
        '(
          tab-bar-format-tabs-groups ;; this shows groups
          ;; tab-bar-format-tabs ;; switch to this for plain tabs
          tab-bar-separator
          activate
          tab-bar-format-align-right
          tab-bar-format-global
          ))

With groups enabled, you'll have to assign a group to one tab to get the group to appear and for the broken formatting path to be invoked.

You can invoke this to ensure there's at least one group for testing (tab-bar-change-tab-group "*default*")

or call M-x tab-group to assign a name interactively.

P.S. While reading through the tab-bar-mode code, it appears there is a bug that, if fixed, might render the PR correction unneeded. Perhaps in Emacs 30 if this is truly a bug and gets reported.

(defun tab-bar-tab-group-face-default (tab)
  (if (not (or (eq (car tab) 'current-tab)
               (funcall tab-bar-tab-group-function tab)))
      'tab-bar-tab-ungrouped
    (tab-bar-tab-face-default tab)))

At the end of the function, tab-bar-tab-face-default is called and not tab-bar-tab-face-function so the override is never applied when groups are being formatted. Since the override would have been set to activities-tabs--tab-bar-tab-face-function the custom face is never applied. Also, to get around this, one can't mix both the tab format and the group format or the tabs get repeated.

Metadata

Assignees

Labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions