From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#56874: 28.1.50; tab-bar-format-align-right should probably use string-width Date: Mon, 01 Aug 2022 21:13:43 +0300 Organization: LINKOV.NET Message-ID: <86pmhjbzmw.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (x86_64-pc-linux-gnu) Cc: 56874@debbugs.gnu.org To: Adam Porter Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Aug 01 20:24:20 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oIa5U-00044S-6N for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 20:24:20 +0200 Original-Received: from localhost ([::1]:49308 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oIa5T-0003jf-3q for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Aug 2022 14:24:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47188) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oIZzP-0000ni-Nn for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 14:18:07 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:51864) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oIZzP-0000Wi-5s for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 14:18:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oIZzP-00027E-1n for bug-gnu-emacs@gnu.org; Mon, 01 Aug 2022 14:18:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Aug 2022 18:18:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56874 X-GNU-PR-Package: emacs Original-Received: via spool by 56874-submit@debbugs.gnu.org id=B56874.16593778618065 (code B ref 56874); Mon, 01 Aug 2022 18:18:03 +0000 Original-Received: (at 56874) by debbugs.gnu.org; 1 Aug 2022 18:17:41 +0000 Original-Received: from localhost ([127.0.0.1]:41608 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIZz2-000260-PF for submit@debbugs.gnu.org; Mon, 01 Aug 2022 14:17:41 -0400 Original-Received: from relay7-d.mail.gandi.net ([217.70.183.200]:50895) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oIZyz-00025R-08 for 56874@debbugs.gnu.org; Mon, 01 Aug 2022 14:17:38 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id 9802C20008; Mon, 1 Aug 2022 18:17:27 +0000 (UTC) In-Reply-To: (Adam Porter's message of "Mon, 1 Aug 2022 11:49:19 -0500") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:238460 Archived-At: > 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. Please check Emacs 29 where tab-bar-format-align-right contains a better improvement: (string-pixel-width (propertize rest 'face 'tab-bar)) Does this work in your case as well?