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#55207: 29.0.50; tab-bar-format-align-right only works correctly with monospace characters Date: Tue, 03 May 2022 20:52:17 +0300 Organization: LINKOV.NET Message-ID: <86sfpqh5s6.fsf@mail.linkov.net> References: <87y1zli75x.fsf@dsemy.com> <86levlf880.fsf@mail.linkov.net> <87bkwhdtd4.fsf@gnus.org> <86r15ddsh1.fsf@mail.linkov.net> <87zgk06jnn.fsf@dsemy.com> <86h767pxe7.fsf@mail.linkov.net> <87mtfzt66k.fsf@dsemy.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="40214"; 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: Lars Ingebrigtsen , 55207@debbugs.gnu.org To: Daniel Semyonov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 03 20:01:47 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 1nlwqJ-000AJk-4G for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 20:01:47 +0200 Original-Received: from localhost ([::1]:41518 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nlwqI-0002tt-4r for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 03 May 2022 14:01:46 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40544) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nlwpb-0002r6-7M for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:47104) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nlwpa-0006gz-Sm for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nlwpa-0001qe-SY for bug-gnu-emacs@gnu.org; Tue, 03 May 2022 14:01:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 03 May 2022 18:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 55207 X-GNU-PR-Package: emacs Original-Received: via spool by 55207-submit@debbugs.gnu.org id=B55207.16516008136981 (code B ref 55207); Tue, 03 May 2022 18:01:02 +0000 Original-Received: (at 55207) by debbugs.gnu.org; 3 May 2022 18:00:13 +0000 Original-Received: from localhost ([127.0.0.1]:40995 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlwon-0001oX-D5 for submit@debbugs.gnu.org; Tue, 03 May 2022 14:00:13 -0400 Original-Received: from relay2-d.mail.gandi.net ([217.70.183.194]:42749) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nlwol-0001mu-TJ for 55207@debbugs.gnu.org; Tue, 03 May 2022 14:00:12 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by mail.gandi.net (Postfix) with ESMTPSA id DF31940009; Tue, 3 May 2022 18:00:03 +0000 (UTC) In-Reply-To: <87mtfzt66k.fsf@dsemy.com> (Daniel Semyonov's message of "Tue, 03 May 2022 10:40:35 +0300") 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:231349 Archived-At: > Hopefully this information proves useful, thank you for looking into > this. Thanks, this helped to realize that the pixel width should be calculated with the same face that is really used on the tab bar. Could you please try a new patch. At least, I see that it works with your test cases. diff --git a/lisp/tab-bar.el b/lisp/tab-bar.el index 03b49e9657..4d5ec4098c 100644 --- a/lisp/tab-bar.el +++ b/lisp/tab-bar.el @@ -915,8 +915,8 @@ tab-bar-format-align-right (let* ((rest (cdr (memq 'tab-bar-format-align-right tab-bar-format))) (rest (tab-bar-format-list rest)) (rest (mapconcat (lambda (item) (nth 2 item)) rest "")) - (hpos (length rest)) - (str (propertize " " 'display `(space :align-to (- right ,hpos))))) + (hpos (string-pixel-width (propertize rest 'face 'tab-bar))) + (str (propertize " " 'display `(space :align-to (- right (,hpos)))))) `((align-right menu-item ,str ignore))))