all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Lars Ingebrigtsen <larsi@gnus.org>
To: Allen Li <vianchielfaura@gmail.com>
Cc: Glenn Morris <rgm@gnu.org>, 30056@debbugs.gnu.org
Subject: bug#30056: 25.3; battery-mode-line-string missing leading space
Date: Thu, 22 Jul 2021 16:15:42 +0200	[thread overview]
Message-ID: <87zgueigdt.fsf@gnus.org> (raw)
In-Reply-To: <87tuxa39c7.fsf@gnus.org> (Lars Ingebrigtsen's message of "Mon, 10 Aug 2020 15:43:20 +0200")

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





  parent reply	other threads:[~2021-07-22 14:15 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10  3:26 bug#30056: 25.3; battery-mode-line-string missing leading space Allen Li
2018-01-10  8:45 ` bug#30056: [PATCH] Add leading space to battery-mode-line-format Allen Li
2018-01-10 15:29 ` bug#30056: 25.3; battery-mode-line-string missing leading space Eli Zaretskii
2018-01-10 17:06   ` Glenn Morris
2018-01-10 19:05     ` Eli Zaretskii
2018-01-10 23:26       ` Allen Li
2018-01-11 15:57         ` Eli Zaretskii
2018-01-12  8:18           ` Allen Li
2020-08-10 13:43             ` Lars Ingebrigtsen
2020-08-11  8:40               ` Allen Li
2020-08-11 11:19                 ` Lars Ingebrigtsen
2020-08-12  7:31                   ` Allen Li
2021-07-22 14:15               ` Lars Ingebrigtsen [this message]
2021-07-23 12:48                 ` Lars Ingebrigtsen
2021-07-23 18:23                   ` Juri Linkov
2021-07-24 11:54                     ` Lars Ingebrigtsen
2021-07-26 23:09                       ` Juri Linkov
2021-07-27 20:56                         ` Juri Linkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zgueigdt.fsf@gnus.org \
    --to=larsi@gnus.org \
    --cc=30056@debbugs.gnu.org \
    --cc=rgm@gnu.org \
    --cc=vianchielfaura@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.