Subject: bug#56874: 28.1.50; tab-bar-format-align-right should probably use string-width

From: Adam Porter <[email-masked]>
Date: Mon, 1 Aug 2022 11:49:19 -0500

Hi Juri, et al,

I noticed that, when I added a mode line construct to global-mode-line 
and enabled the display of such in the tab line (using 
tab-bar-format-align-right, etc.), the construct wrapped onto a second 
line in the tab bar.  I looked at the source code of 
tab-bar-format-align-right and noticed that it uses length instead of 
string-width.  I changed it to string-width and it fixed the problem.

Note that a similar problem remains: if the tab-bar face has, for 
example, a larger height than the default face, the width will still be 
incorrectly calculated, causing wrapping onto a new line.  I don't know 
how to fix that, since window-text-pixel-size requires a buffer and a 
window.

But this is an improvement, anyway.

Thanks,
Adam