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

From: Juri Linkov <[email-masked]>
Date: Fri, 19 Jul 2024 09:42:41 +0300

>> Please see the attached patches, where the first three commits are
>> intended to be applied to the emacs-30 branch, and the final commit
>> removes the obsolete `tab-bar-auto-width-faces' on master.

Thanks for the patches, although I agree with Eli that the changes
on emacs-30 should be minimal.

> I'm not sure I understand why they need to be installed on emacs-30.
> Is this a regression in Emacs 29 or Emacs 30?  What bad things will
> happen if we install the changes on master instead>

Replacing hard-coded logic with customizable variable
for external packages like activities.el is needed
as soon as possible on emacs-30 because hard-coded logic
hinders the use of packages.

However, there is no hurry to change the default behavior
to match a symbol name instead of checking face names.
Therefore I think better to move the existing code

  (memq (get-text-property 0 'face (nth 2 item)) tab-bar-auto-width-faces)

to the new predicate function on emacs-30.  Then activities.el
can change it to another function that matches a symbol.

Then on master the default body on the new predicate
could be replaced from checking the face to match a symbol.
Also changes in tab-bar--format-tab-group should be on master as well.

>> Does this change warrant a NEWS entry?
>
> Yes, since you are adding a hook variable.  Obsolescence of a variable
> also requires a NEWS entry.

Then addition of tab-bar-auto-width-functions requires a NEWS entry on emacs-30.
And obsolescence of tab-bar-auto-width-faces requires a NEWS entry on master.

>> * lisp/tab-bar.el (tab-bar-auto-width-faces):  Remove.
>> (tab-bar-auto-width): Only run tab-bar-auto-width-functions.
>
> We don't usually remove a variable one major release after it has been
> obsoleted.  It's too soon.

Indeed, it could be obsoleted on master.
This will provide a minimal set of changes on emacs-30.