* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
@ 2022-09-29 21:37 miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-30 5:50 ` Eli Zaretskii
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-09-29 21:37 UTC (permalink / raw)
To: 58183
[-- Attachment #1: Type: text/plain, Size: 102 bytes --]
Graphical emacsclient frames have modelines that look something like
U: @---
instead of
U:@----
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 861 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
2022-09-29 21:37 bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-09-30 5:50 ` Eli Zaretskii
2022-09-30 12:59 ` Lars Ingebrigtsen
2023-07-28 10:48 ` Ulrich Müller
2 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-09-30 5:50 UTC (permalink / raw)
To: miha; +Cc: 58183
> Date: Thu, 29 Sep 2022 23:37:50 +0200
> From: miha--- via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> Graphical emacsclient frames have modelines that look something like
>
> U: @---
>
> instead of
>
> U:@----
I cannot reproduce this. Please show a full recipe starting from
"emacs -Q".
Thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
2022-09-29 21:37 bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-30 5:50 ` Eli Zaretskii
@ 2022-09-30 12:59 ` Lars Ingebrigtsen
2022-09-30 13:39 ` Eli Zaretskii
2023-07-28 10:48 ` Ulrich Müller
2 siblings, 1 reply; 6+ messages in thread
From: Lars Ingebrigtsen @ 2022-09-30 12:59 UTC (permalink / raw)
To: miha; +Cc: 58183
miha@kamnitnik.top writes:
> Graphical emacsclient frames have modelines that look something like
>
> U: @---
>
> instead of
>
> U:@----
It seems to have something to do with the min-width display property.
When the client element is present, the default format is making the "U:"
element five chars wide instead of the entire "U:@---".
To experiment:
(setq mode-line-format
'("%e" mode-line-front-space (:propertize ("" mode-line-mule-info mode-line-client mode-line-modified mode-line-remote)
display (min-width (5.0)))
mode-line-frame-identification mode-line-buffer-identification " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces))
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
2022-09-30 12:59 ` Lars Ingebrigtsen
@ 2022-09-30 13:39 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2022-09-30 13:39 UTC (permalink / raw)
To: Lars Ingebrigtsen; +Cc: 58183, miha
> Cc: 58183@debbugs.gnu.org
> From: Lars Ingebrigtsen <larsi@gnus.org>
> Date: Fri, 30 Sep 2022 14:59:39 +0200
>
> miha@kamnitnik.top writes:
>
> > Graphical emacsclient frames have modelines that look something like
> >
> > U: @---
> >
> > instead of
> >
> > U:@----
>
> It seems to have something to do with the min-width display property.
> When the client element is present, the default format is making the "U:"
> element five chars wide instead of the entire "U:@---".
>
> To experiment:
>
> (setq mode-line-format
> '("%e" mode-line-front-space (:propertize ("" mode-line-mule-info mode-line-client mode-line-modified mode-line-remote)
> display (min-width (5.0)))
> mode-line-frame-identification mode-line-buffer-identification " " mode-line-position (vc-mode vc-mode) " " mode-line-modes mode-line-misc-info mode-line-end-spaces))
This doesn't show the extra spaces here. Strange.
^ permalink raw reply [flat|nested] 6+ messages in thread
* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
2022-09-29 21:37 bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-30 5:50 ` Eli Zaretskii
2022-09-30 12:59 ` Lars Ingebrigtsen
@ 2023-07-28 10:48 ` Ulrich Müller
2023-07-28 12:40 ` Eli Zaretskii
2 siblings, 1 reply; 6+ messages in thread
From: Ulrich Müller @ 2023-07-28 10:48 UTC (permalink / raw)
To: 58183; +Cc: Eli Zaretskii, Lars Ingebrigtsen, miha
The following patch fixes the problem for me.
TBH I don't entirely understand why it fixes it (the code in xdisp.c
related to display properties is complicated). Apparently it has
something to do with properties calculated in advance vs calculated
in a :propertize form, which seems to affect what characters belong
to the min-width sequence.
From fc283c40871b050ba6a58d7dd2957f6e19633d73 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <ulm@gentoo.org>
Date: Fri, 28 Jul 2023 12:21:42 +0200
Subject: [PATCH] Kill spurious whitespace in the modeline of emacsclient
frames
* lisp/bindings.el (mode-line-client): Compute text properties
in advance. (bug#58183)
---
lisp/bindings.el | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/lisp/bindings.el b/lisp/bindings.el
index 0a0fef1b564..22f05939235 100644
--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -226,9 +226,9 @@ mode-line-mule-info
(put 'mode-line-mule-info 'risky-local-variable t)
(defvar mode-line-client
- `(""
- (:propertize ("" (:eval (if (frame-parameter nil 'client) "@" "")))
- help-echo ,(purecopy "emacsclient frame")))
+ `(:eval
+ (if (frame-parameter nil 'client)
+ ,(propertize "@" 'help-echo (purecopy "emacsclient frame"))))
"Mode line construct for identifying emacsclient frames.")
;; Autoload if this file no longer dumped.
;;;###autoload
--
2.41.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline
2023-07-28 10:48 ` Ulrich Müller
@ 2023-07-28 12:40 ` Eli Zaretskii
0 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2023-07-28 12:40 UTC (permalink / raw)
To: Ulrich Müller; +Cc: 58183-done, larsi, miha
> From: Ulrich Müller <ulm@gentoo.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>,
> <miha@kamnitnik.top>
> Date: Fri, 28 Jul 2023 12:48:40 +0200
>
> The following patch fixes the problem for me.
Thanks, installed on the master branch, and closing the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-28 12:40 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-29 21:37 bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline miha--- via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-09-30 5:50 ` Eli Zaretskii
2022-09-30 12:59 ` Lars Ingebrigtsen
2022-09-30 13:39 ` Eli Zaretskii
2023-07-28 10:48 ` Ulrich Müller
2023-07-28 12:40 ` Eli Zaretskii
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).