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#30056: 25.3; battery-mode-line-string missing leading space Date: Tue, 27 Jul 2021 02:09:27 +0300 Organization: LINKOV.NET Message-ID: <87y29s7jep.fsf@mail.linkov.net> References: <83fu7d68bf.fsf@gnu.org> <834lnt5ybx.fsf@gnu.org> <83mv1k4cd1.fsf@gnu.org> <87tuxa39c7.fsf@gnus.org> <87zgueigdt.fsf@gnus.org> <87eebpdwmv.fsf@gnus.org> <87pmv8yk0t.fsf@mail.linkov.net> <87r1fo2agu.fsf@gnus.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23182"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Allen Li , 30056@debbugs.gnu.org, Glenn Morris To: Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 27 01:22:13 2021 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 1m89vG-0005sD-It for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 27 Jul 2021 01:22:10 +0200 Original-Received: from localhost ([::1]:54718 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1m89vE-0002xP-Qd for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 26 Jul 2021 19:22:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50778) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1m89v8-0002xF-Pk for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40187) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1m89v8-00019u-Hm for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1m89v8-0003Qv-CE for bug-gnu-emacs@gnu.org; Mon, 26 Jul 2021 19:22: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: Mon, 26 Jul 2021 23:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30056 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 30056-submit@debbugs.gnu.org id=B30056.162734169713167 (code B ref 30056); Mon, 26 Jul 2021 23:22:02 +0000 Original-Received: (at 30056) by debbugs.gnu.org; 26 Jul 2021 23:21:37 +0000 Original-Received: from localhost ([127.0.0.1]:51733 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m89uj-0003QJ-2P for submit@debbugs.gnu.org; Mon, 26 Jul 2021 19:21:37 -0400 Original-Received: from relay5-d.mail.gandi.net ([217.70.183.197]:34613) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1m89uh-0003Q6-Hm for 30056@debbugs.gnu.org; Mon, 26 Jul 2021 19:21:36 -0400 Original-Received: (Authenticated sender: juri@linkov.net) by relay5-d.mail.gandi.net (Postfix) with ESMTPSA id 5F9671C0003; Mon, 26 Jul 2021 23:21:27 +0000 (UTC) In-Reply-To: <87r1fo2agu.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 24 Jul 2021 13:54:41 +0200") 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:210774 Archived-At: >> This change broke tab-bar.el that expected that the default value of >> mode-line-misc-info contains (global-mode-string ("" global-mode-string " ")). > > I've now updated the code in tab-bar.el. But isn't that a brittle way > to enable this? The user may have altered the variable value, for instance. This code is just for convenience to avoid duplication of the global string on the mode-line and on the tab-bar. When the user alters mode-line-misc-info manually, then we can assume that the user does this intentionally, e.g. to force duplication of the global string, etc. But the default value of mode-line-misc-info doesn't change too often, so there is no problem. However, there is another problem: now display-time-string contains additional trailing space, so when time is displayed on the right edge on the tab-bar, time string is not aligned nicely anymore. Now there is the gap between the time string and the right edge of the tab-bar. How this could be avoided? Maybe tab-bar-format-global now needs to use 'string-trim' on the result of '(format-mode-line global-mode-string)'?