unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 52183@debbugs.gnu.org, dm@mssdvd.com
Subject: bug#52183: 29.0.50; Empty space in the mode line if server-mode is active
Date: Sun, 05 Dec 2021 08:59:25 +0200	[thread overview]
Message-ID: <831r2r5ygi.fsf@gnu.org> (raw)
In-Reply-To: <87zgpgxc5e.fsf@gnus.org> (message from Lars Ingebrigtsen on Sat,  04 Dec 2021 23:01:33 +0100)

> From: Lars Ingebrigtsen <larsi@gnus.org>
> Cc: dm@mssdvd.com,  52183@debbugs.gnu.org
> Date: Sat, 04 Dec 2021 23:01:33 +0100
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > The main point of what I wrote is that we actually display the whole
> > 5-to-6 character sequence of indicators as 4 separate strings, not as
> > a single string made of concatenation of those 4.  So even if/when the
> > min-width stuff is fixed as we discussed, you will have 4 strings
> > displayed one after the other, and each one of them has the min-width
> > spec, so each one of them will be displayed as at least 5 characters.
> > And that's not what you want here.
> 
> It sounds like much the same thing that happens when doing the
> " (%l,%c)" -- you also get two strings then, which is why the min-width
> end handler checks that we're really at the end of the sequence of strings.

That's sheer luck, an artifact of the particular implementation in
display_min_width.  Specifically, the stretch glyph is appended when
we see a new Lisp string, so the " " separator after those elements
plays that role.  That's why we get that extra space before "@" in the
situation described by this bug report: that "@" is the first Lisp
string that follows mode-line-mule-info, and mode-line-mule-info is
produced as C strings.

So another way to fix this is to introduce a new mode-line construct,
say %=, which will produce either an empty string or "@" for client
frames, as C strings, and use that as mode-line-client element.  Then
all of those 4 elements will be produced as C strings, and the problem
reported in this bug report will be solved.  But then the change we
discussed that would allow processing such properties on C strings
will again break this, because it will apply min-width to each
separate C string in this group of indicators.

Basically, the way we display the mode line with text properties only
works for properties that have the same effect if applied to each part
of a string separately, or to the entire string in one go.  Faces and
help-echo are like that; but the min-width display spec isn't, because
it takes effect when the string _ends_, so where the string ends and
how many strings are there is important for it.  Thus, concatenating
the strings before propertizing is really needed for this to work on a
group of strings.





  reply	other threads:[~2021-12-05  6:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-29 15:59 bug#52183: 29.0.50; Empty space in the mode line if server-mode is active Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30  8:57 ` bug#52183: (29.0.50; Empty space in the mode line if server-mode is active) Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30 16:52   ` Eli Zaretskii
2021-11-30 17:52     ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-11-30 18:30       ` Eli Zaretskii
2021-12-04  9:35 ` bug#52183: 29.0.50; Empty space in the mode line if server-mode is active Eli Zaretskii
2021-12-04  9:56   ` Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2021-12-04 10:29     ` Eli Zaretskii
2021-12-04 11:59       ` Eli Zaretskii
2021-12-04 19:04         ` Lars Ingebrigtsen
2021-12-04 19:36           ` Eli Zaretskii
2021-12-04 22:01             ` Lars Ingebrigtsen
2021-12-05  6:59               ` Eli Zaretskii [this message]
2021-12-05 20:04                 ` Lars Ingebrigtsen
     [not found] ` <handler.52183.B.163820159613081.ack@debbugs.gnu.org>
2023-07-28 14:43   ` bug#52183: Acknowledgement (29.0.50; Empty space in the mode line if server-mode is active) Davide Masserut via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-29 11:22     ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=831r2r5ygi.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=52183@debbugs.gnu.org \
    --cc=dm@mssdvd.com \
    --cc=larsi@gnus.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).