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: Sat, 04 Dec 2021 13:59:56 +0200 [thread overview]
Message-ID: <83tufo60n7.fsf@gnu.org> (raw)
In-Reply-To: <83wnkk64tz.fsf@gnu.org> (message from Eli Zaretskii on Sat, 04 Dec 2021 12:29:28 +0200)
> Date: Sat, 04 Dec 2021 12:29:28 +0200
> From: Eli Zaretskii <eliz@gnu.org>
> Cc: 52183@debbugs.gnu.org
>
> > From: Davide Masserut <dm@mssdvd.com>
> > Cc: 52183@debbugs.gnu.org
> > Date: Sat, 04 Dec 2021 10:56:17 +0100
> >
> > Eli Zaretskii <eliz@gnu.org> writes:
> >
> > > Do you still see this on the current master? I seem to be unable to
> > > reproduce this today.
> >
> > I'm still seeing it on "3e7aff5fcdd3fa6e30497323c914f6c79c951ed6".
>
> Ignore me: I wasn't testing this properly.
I think I understand the root cause of this.
bindings.el produce this part of mode line as follows:
(list
:propertize
(list ""
'mode-line-mule-info
'mode-line-client
'mode-line-modified
'mode-line-remote)
'display '(min-width (5.0)))
This presumes that the values of the mode-line-* variables mentioned
there will be concatenated, then the display property with the
min-width spec added to the result of the concatenation, and then the
result will be displayed.
But that's not how the mode-line display works. The "concatenation",
as mentioned in the ELisp manual:
‘(STRING REST...)’
‘(LIST REST...)’
A list whose first element is a string or list means to process all
the elements recursively and concatenate the results.
is not a real concatenation that produces a Lisp string, it is a
"effective concatenation" that happens on display, because the
elements of the list are displayed one after the other. Any string in
the list gets the properties specified in :propertize applied to it
_before_ displaying it, but text properties on C strings are ignored
when they are displayed, and so have no effect.
Now the way min-width is implemented, if we display a series of C
strings, then display a Lisp string, the min-width will have effect
before the Lisp string is displayed. Which is what happens here: the
"@" indicator is computed in bindings.el as a Lisp string. Without
the "@" part, the " " string that follows the above group of
indicators plays the role of that Lisp string, so the min-width thing
_seems_ to work as intended when all the 4 parts above are either C
strings or empty strings.
Bottom line: I think to make this work as intended, bindings.el should
be modified to produce a Lisp string from all those 4 elements, by
concatenating them, and then the min-width display spec should be put
on the result of the concatenation.
next prev parent reply other threads:[~2021-12-04 11: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 [this message]
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
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=83tufo60n7.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).