Subject: Re: bug#71883: [PATCH] Fix tab-bar-auto-width with customized tab-bar-tab-face-function

From: Juri Linkov <[email-masked]>
Date: Tue, 06 Aug 2024 09:59:51 +0300

Thanks for the patches.

> -   `((,(intern (format "group-%i" i))
> +   `((,(intern (if current-p "current-group" (format "group-%i" i)))

I pushed this part to master now.

> +(defun tab-bar-auto-width-predicate-default (item)
> +  "Accepts tab ITEM and returns non-nil for tabs and tab groups."
> +  (string-match-p
> +   ;; (rx bos (or "current-tab" "current-group" "tab-" "group-"))
> +   "\\`\\(?:current-\\(?:group\\|tab\\)\\|\\(?:group\\|tab\\)-\\)"
> +   (symbol-name (nth 0 item))))

In this part please remove the current group from the default implementation,
because it looks too ugly, and it was not resized before this change, since
tab-bar-auto-width-faces didn't contain the tab-bar-tab-group-current face.

> -        (if (memq (get-text-property 0 'face (nth 2 item))
> -                  tab-bar-auto-width-faces)
> +        (if (run-hook-with-args-until-success 'tab-bar-auto-width-functions item)

I wonder how users are supposed to handle tab-bar-tab-ungrouped now?
Since it can't be distinguished from grouped tabs (both have tab- symbols),
is this how users should customize this now:

  (setq tab-bar-auto-width-functions
        `(,(lambda (item)
             (and (string-match-p
                   "\\`\\(?:current-tab\\|\\(?:group\\|tab\\)-\\)" (symbol-name (nth 0 item)))
                  (not (eq (get-text-property 0 'face (nth 2 item))
                           'tab-bar-tab-ungrouped))))))

> +(make-obsolete-variable 'tab-bar-auto-width-faces 'tab-bar-auto-width-functions "30")
> [...]
> +*** The 'tab-bar-auto-width-faces' variable is now obsolete.
> +Use 'tab-bar-auto-width-functions' instead.

Actually I see no need to obsolete the variable instead of deleting it right away
since it's not used anywhere anymore.