Subject: bug#79141: 31.0.50; The tab-bar-format-align-right cache doesn't take face changes and per-frame faces into account

From: Eli Zaretskii <[email-masked]>
Date: Wed, 06 Aug 2025 22:25:03 +0300

> Cc: Daniel Mendler <[email-masked]>, [email-masked]
> Date: Wed, 06 Aug 2025 09:32:19 -0700
> From:  Steven Allen via "Bug reports for GNU Emacs,
>  the Swiss army knife of text editors" <[email-masked]>
> 
> If modifying Emacs core is on the table, the simplest solution I can
> think of is to:
> 
> 1. Have a per-frame cache.
> 2. Update a global `face-modification-tick' (similar to
> `buffer-modification-tick') whenever faces are updated, invalidating the
> cache whenever this changes.

Please be advised that the current code invalidates the frame's face
cache and frees all the faces whenever some face is changed.  That's
because we don't currently track face dependencies, and so have no
idea what other faces will change as result of changing some face.  So
if you want a more efficient face cache, you first need to solve this
dependency-tracking issue.