Open shipmints opened 4 months ago
See #108.
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.
Would you please report that bug, then? If it is truly a bug (you should probably cc Juri on it, as he's the maintainer of that library), then it might not be too late to get it fixed in Emacs 30. Then, if it's as you say, we might be able to omit the change here.
Bug reported for confirmation https://lists.gnu.org/archive/html/bug-gnu-emacs/2024-06/msg01468.html
Looks like we need this small change afterall. I did not check Juri's contention. It's his code.
From: | Juri Linkov Subject: | bug#71733: 29.3; tab-bar-tab-group-face-default invokes tab-bar-tab-face-default incorrectly? Date: | Sun, 23 Jun 2024 20:30:48 +0300
tags 71733 wontfix close 71733 30.0.50 thanks
tab-bar-tab-group-face-default' hard codes the invocation to
tab-bar-tab-face-default' but should it instead invoke `tab-bar-tab-face-function' to benefit from a custom function?(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))) ;; should the last line be something like this? (funcall tab-bar-tab-face-function tab)))
I checked the latest `tab-bar' source code this morning and this hasn't yet been addressed, if indeed this is unintended behavior.
Sorry, this can't be changed because it will cause an infinite recursion. You can see in 'tab-bar-format-tabs-groups':
(let ((tab-bar-tab-face-function
tab-bar-tab-group-face-function))
(tab-bar--format-tab tab i))
Then with the default value 'tab-bar-tab-group-face-default' of 'tab-bar-tab-group-face-function', 'tab-bar-tab-face-function' in 'tab-bar-tab-group-face-default' will recursively call itself.
Ok, thanks for checking on that.
Juri said in a later email to me that he will improve the documentation. Our approach is the right one.
activities
needs to respecttab-bar-mode
'stab-bar-tab-group-face-function
override in the same way it currently respectstab-bar-tab-face-function
. The lack of support means that theactivities-tab
face is never applied.A PR coming shortly with the tested fix for this.
Configuration snippet for testing:
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.At the end of the function,
tab-bar-tab-face-default
is called and nottab-bar-tab-face-function
so the override is never applied when groups are being formatted. Since the override would have been set toactivities-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.