Subject: bug#76761: 31.0.50; Image icons from 'icons.el' could be accidentally dropped

From: Eli Zaretskii <[email-masked]>
Date: Thu, 06 Mar 2025 16:21:15 +0200

> From: Pengji Zhang <[email-masked]>
> Cc: [email-masked]
> Date: Thu, 06 Mar 2025 17:59:06 +0800
> 
> Eli Zaretskii <[email-masked]> writes:
> 
> > Isn't that rather a bug in mode-line-compact?  It shouldn't remove
> > spaces which have 'display' properties on them, since they are not
> > "empty space" on the mode line.
> 
> Yes, I agree that we probably need to fix 'mode-line-compact' as well.
> However, other than 'mode-line-compact', 'string-split', 'string-trim',
> and some other commonly used string functions could also remove such
> "non-empty spaces" unexpectedly. Image icons are the only thing that
> brings me trouble. So I am reporting it as an 'icons.el' bug. Besides,
> IMO it is less intrusive to change 'icons.el'.

Any character can be removed, so replacing the space will not solve
the problem, not in general.  It could make it less frequent, but
that's all.

As for other functions, Lisp programs which call them should be aware
of the issue and code their implementations accordingly.

Using space characters for showing images and other stuff is
ubiquitous in Emacs, so replacing all of them doesn't sound attractive
to me.