Subject: Re: bug#58183: 29.0.50; Extra spacing before '@' in emacsclient modeline

From: Ulrich Müller <[email-masked]>
Date: Fri, 28 Jul 2023 12:48:40 +0200

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?= <[email-masked]>
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