Subject: 30.0.50; [PATCH] Tab bar group format not applied to current

From: Gabriel <[email-masked]>
Date: Wed, 14 Dec 2022 17:16:24 -0300

Description:

The user option 'tab-bar-tab-group-format-function' is not applied to
current group tab, only to other group tabs.  I suspect this is not
intentional and could be fixed by the attached patch.

Steps:

1) emacs -Q (master "42c757913a4c6acc07f8904df7def6b720bb23b4")

2) Enable tab bar and create some tabs and groups:

(progn
  (tab-bar-mode 1)
  (tab-bar-change-tab-group "group1")
  (tab-new)
  (tab-bar-change-tab-group "group2")
  (tab-new)
  (tab-bar-change-tab-group "group2")
  (tab-new)
  (tab-bar-change-tab-group "group3"))

3) Set a custom function to format group tabs:

(progn
  (defun my-tab-bar-group-format (tab i)
    (format "<%s (%s)>"
        (funcall tab-bar-tab-group-function tab)
        i))
  (setopt tab-bar-format '(tab-bar-format-tabs-groups)
      tab-bar-tab-group-format-function 'my-tab-bar-group-format))

4) Change tabs a couple of times with 'C-x t o' ('tab-next')

Result: The 'tab-bar-tab-group-format-function' is not applied to format
the current group tab, only to other group tabs.  See attach patch for a
proposed fix.  If this behavior is intentional, I propose to update the
doc string.

>From da2025d524da5b76e4f2bc81d51899d9b798888c Mon Sep 17 00:00:00 2001
From: Gabriel do Nascimento Ribeiro <[email-masked]>
Date: Wed, 14 Dec 2022 17:10:28 -0300
Subject: [PATCH 1/1] Fix incorrect format of current tab bar group

* lisp/tab-bar.el (tab-bar--format-tab-group): Make proper use of
'tab-bar--format-tab-group' to format the current tab bar group.
---
 lisp/tab-bar.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el
index 162e63fe23..65e424080d 100644
--- a/lisp/tab-bar.el
+++ b/lisp/tab-bar.el
@@ -882,7 +882,7 @@ tab-bar--format-tab-group
    `((,(intern (format "group-%i" i))
       menu-item
       ,(if current-p
-           (propertize (funcall tab-bar-tab-group-function tab)
+           (propertize (funcall tab-bar-tab-group-format-function tab i)
                        'face 'tab-bar-tab-group-current)
          (funcall tab-bar-tab-group-format-function tab i))
       ,(if current-p 'ignore
-- 
2.34.1

---
Gabriel