bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#30056: 25.3; battery-mode-line-string missing leading space


From: Lars Ingebrigtsen
Subject: bug#30056: 25.3; battery-mode-line-string missing leading space
Date: Thu, 22 Jul 2021 16:15:42 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Indeed.  Just a random idea: Would it make sense to add a mode line
> construct like "%S" to mode-line-format that means "put a space here if
> there isn't one already"?  Then battery could put "%S<current string"
> into the list?

I had a peek at how to implement this, and it's surprisingly hard.  The
mode line stuff is constructed in three different paths
(noprop/string/display), and getting at the "previous character" is
different in every case.

And I'm not really super enthusiastic about the idea in general, because
it means that simple strings (like battery-mode-line-string) will have
to be replaced by ("%S" battery-mode-line-string) lists...

So perhaps we just have to bite the bullet and introduce a new
convention: All `global-mode-string' bits have to start with a space
character (and we'll remove the trailing character from
`mode-line-modes').

This'll make some of these modes look awkward until they're all fixed.

A less breakey change is to institute a different rule: All
`global-mode-string' elements have to have a trailing space.  That'll be
less breakey, but may add spaces before the "----" in terminals.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no





reply via email to

[Prev in Thread] Current Thread [Next in Thread]