GNU bug report logs - #76761
31.0.50; Image icons from 'icons.el' could be accidentally dropped

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: Pengji Zhang <me@HIDDEN>; dated Wed, 5 Mar 2025 10:11:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 76761 <at> debbugs.gnu.org:


Received: (at 76761) by debbugs.gnu.org; 6 Mar 2025 12:21:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 06 07:21:17 2025
Received: from localhost ([127.0.0.1]:41811 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tqAE1-000214-1U
	for submit <at> debbugs.gnu.org; Thu, 06 Mar 2025 07:21:17 -0500
Received: from fout-a7-smtp.messagingengine.com ([103.168.172.150]:58127)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1tqADv-00020e-PB
 for 76761 <at> debbugs.gnu.org; Thu, 06 Mar 2025 07:21:12 -0500
Received: from phl-compute-02.internal (phl-compute-02.phl.internal
 [10.202.2.42])
 by mailfout.phl.internal (Postfix) with ESMTP id 8C962138283C;
 Thu,  6 Mar 2025 07:21:06 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-02.internal (MEProxy); Thu, 06 Mar 2025 07:21:06 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengjiz.com; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm2; t=1741263666; x=1741350066; bh=HBvLH6LWz4
 apquwJWZIUPcXqCgEGWMEZ9SCwnRuQFcc=; b=L6mL3Ia/ZhSaAbL+TrDj8+usNB
 6iLh4PIM0HjeF8tEw7OZs4QpjnRg5JO6Xc/NPnmhMV09bQASTvTbYX4rrQ0f7ErL
 LG9iXvHI6z1Vzx3YxlzntK/6jX9zVZKXzCpzVm+mvy5l37dmDudo94qClO8ywp9M
 ZF+9FZM30lfGfIutqVye7Mg7Fr8dKfMMv96IKhuDQkH6DciRMpQIe5h9xNMFSkLH
 WueF44bDc/uR5E9FhqK8mXmSqcstyeavWsEW77y8uvfmLGqcmC9XliiWG+Kl6a/N
 1wAFBrMLESbWyEvCt6dkLpUJ+RguFTwOci9X/DfoE62sqWvzFImLptJf5CXQ==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
 1741263666; x=1741350066; bh=HBvLH6LWz4apquwJWZIUPcXqCgEGWMEZ9SC
 wnRuQFcc=; b=NojcnpaLSy8ia5dBrlGiW7tlNvxdmiiOw0j6N+QEzItGAlk0BgI
 eGBLZHomSUQXamCw2oPEgbxaoA3mLT3z75WhTE/FG3E/RebStbAeVvXgTHZV3HQA
 3AMqpd5kiOrKnRJEWlu2gqmegotZ3mR4nOg9lXq5O8NYBAm30QfqFptUC2sGb5Ck
 HVfeD0FD0yT0WxNbocqbCZYYcf1ldNd3awgow0bxCYN2/tNUyqU7sQ7UG6EQ8X21
 Ppv2IVb3OYZRv49cVsRohj0yXN6WhURS5vgMX9wU+YzoDcvj0MCGXI6owtb+HOzf
 FjiY0GLUDSo4+LCIKvzfnEUqcv/gtoI8C1A==
X-ME-Sender: <xms:MpPJZ3JIETjq5rrNA5uJq2c_BR_JE8Ele_5DsIoJuDfGkpA2E-QuMg>
 <xme:MpPJZ7JggFNz9v3Sq4gy6sx0J15rdk9h_e-lCUxjq11nphM3n_pB2R-KHLccUgNol
 FWmj85iXaXEp3qdaHw>
X-ME-Received: <xmr:MpPJZ_tvAVz4jsPZaXc6-INFJ2Ic5NYzvzzVCcM7RDKdbN_vusnUfkdsIg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdejjeegucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
 pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih
 gvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddt
 necuhfhrohhmpefrvghnghhjihcukghhrghnghcuoehmvgesphgvnhhgjhhiiidrtghomh
 eqnecuggftrfgrthhtvghrnhepgeefieeivddukeeitdegudeftdevtdeuteeifffhvdeh
 ffetgfeijeeileelheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg
 hilhhfrhhomhepmhgvsehpvghnghhjihiirdgtohhmpdhnsggprhgtphhtthhopedvpdhm
 ohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtph
 htthhopeejieejieduseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:MpPJZwacf6E5EyIWgwl2Tt2shqLu1yFW6tVE9lvDxDRJEU59fEm8xg>
 <xmx:MpPJZ-aWTq921OtxXV83KFr36UsYUJGo7m1ZYm1PQI1Cuyqc2wsAxw>
 <xmx:MpPJZ0CA91DADpTXypEj75WcRAr1OgMW8pO8rSrmCs6wyNQ_NGNvWQ>
 <xmx:MpPJZ8asOASI5KBwsRf-6XfYdZz-ZtG3OwAc12p6lQ7GirTewAEK0w>
 <xmx:MpPJZ9la484dIDDrMkebx_kn7PskyNBHGHm1-lPZhV_1IgtAN-o3j8_v>
Feedback-ID: i16614472:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 6 Mar 2025 07:21:04 -0500 (EST)
From: Pengji Zhang <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76761: 31.0.50; Image icons from 'icons.el' could be
 accidentally dropped
In-Reply-To: <86y0ximqw1.fsf@HIDDEN>
References: <87frjr949t.fsf@HIDDEN> <86wmd3oagj.fsf@HIDDEN>
 <86y0ximqw1.fsf@HIDDEN>
Date: Thu, 06 Mar 2025 20:20:56 +0800
Message-ID: <87zfhy2vvb.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 76761
Cc: 76761 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

> Could you try the patch below and see if gives good results?
>
> [...]

Thanks! It fixes the issue with 'mode-line-compact'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76761; Package emacs. Full text available.

Message received at 76761 <at> debbugs.gnu.org:


Received: (at 76761) by debbugs.gnu.org; 6 Mar 2025 09:59:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 06 04:59:20 2025
Received: from localhost ([127.0.0.1]:41616 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tq80e-0003MI-A7
	for submit <at> debbugs.gnu.org; Thu, 06 Mar 2025 04:59:20 -0500
Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]:46223)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1tq80b-0003Lw-6k
 for 76761 <at> debbugs.gnu.org; Thu, 06 Mar 2025 04:59:18 -0500
Received: from phl-compute-01.internal (phl-compute-01.phl.internal
 [10.202.2.41])
 by mailfout.phl.internal (Postfix) with ESMTP id 72C7B13827B1;
 Thu,  6 Mar 2025 04:59:10 -0500 (EST)
Received: from phl-mailfrontend-01 ([10.202.2.162])
 by phl-compute-01.internal (MEProxy); Thu, 06 Mar 2025 04:59:10 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengjiz.com; h=
 cc:cc:content-type:content-type:date:date:from:from:in-reply-to
 :in-reply-to:message-id:mime-version:references:reply-to:subject
 :subject:to:to; s=fm2; t=1741255150; x=1741341550; bh=nkBZqMbquN
 5E0tIU4dtUu6Db5oPfK0c3LtgAIQLXI34=; b=hdvpRSqdYkxWESWLcDHzCOKnZ2
 2s0wsQRxlKfScjZaIyCsR7uO6m11SgcvxztlaDH1pwqEKuoMrI4bvUIlN+CMgT5P
 lS67tyFY1ZwZEkiOmx3ybXfeI1W8Nk5P3VxgSSsPgh2N8qt4YzAbr0SWhRX2aa80
 NW2ZTXFe6Dx853m0c6IXFoUjI4y2Q0VFeUJo4suN6o+nUveGCeAMXcUFGwU/ctNG
 a5jJYrFM5NCARkq39kGNcTVrmvCfHpwO5R6OsIkQg8qYZ+QoU4dW53bt+j95lJLN
 tKj1imOawNidXMbYq0fHu+qPZwY4Bfl9qn0MN/CoaGt06spAWRK3DKJwVo9A==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to
 :message-id:mime-version:references:reply-to:subject:subject:to
 :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=
 1741255150; x=1741341550; bh=nkBZqMbquN5E0tIU4dtUu6Db5oPfK0c3Ltg
 AIQLXI34=; b=gtGuNCpqpOC55ox8RJHXi0WaoptRAMXRvCZaesMCljfOl+Pde+Y
 RhgduKFBcLKu776olIzcfMGZq2MKEZTBSPNN9VKL0KEudSku9C5wPxBtRIbnwX5Q
 9uVT+P7uwYAH5dbvKos8YFg1fl/Bp0cJ8/xIJrq6u/8omuXM7JLAxt+05TUHbATn
 uqfF7MY6Q33v6yC7FTt/SYaSBv+vg7HnuYfPUWQj+n0BHCzzaYHIU3SG7sZ1oWk/
 xwdgUv4kMec6qzYOO7WUn5rWcdifS2/B6qDu80VArVNOarwVOPJva5NnptkGuAEp
 mRpR0ipwLlejiRCNrjChKo7P+yd6C0jy2pg==
X-ME-Sender: <xms:7XHJZyoD86pJBslXk0nMKUtnOU5sUyKO6rcnj-IctGvfnYEs1LOVWw>
 <xme:7XHJZwox_rz7qtGgPJFOwciQcsACYOb92Zlvbg6tVdmiBQ6QEP_0NSsivXbhfjMPt
 CuDI1n8ZmACl9PwljI>
X-ME-Received: <xmr:7XHJZ3M14rAr1KzsbC52ZLtjBgKKC4X7iAQvRZ5KNWc8-ccp8y9awUpIGg>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdejgeehucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
 pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih
 gvnhhtshculddquddttddmnecujfgurhephffvvefujghffffkgggtsehttdertddttddt
 necuhfhrohhmpefrvghnghhjihcukghhrghnghcuoehmvgesphgvnhhgjhhiiidrtghomh
 eqnecuggftrfgrthhtvghrnhepgeefieeivddukeeitdegudeftdevtdeuteeifffhvdeh
 ffetgfeijeeileelheegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg
 hilhhfrhhomhepmhgvsehpvghnghhjihiirdgtohhmpdhnsggprhgtphhtthhopedvpdhm
 ohguvgepshhmthhpohhuthdprhgtphhtthhopegvlhhiiiesghhnuhdrohhrghdprhgtph
 htthhopeejieejieduseguvggssghughhsrdhgnhhurdhorhhg
X-ME-Proxy: <xmx:7XHJZx6APdETDTPLUlGQV1JvLYcKBA8l_33iXtks56734L4jdkqLzA>
 <xmx:7XHJZx5FNrS8d5j0Br2HpV5AHjd5_esBcc65Po1VTc0DQqaiYaIZ1Q>
 <xmx:7XHJZxj-wrl16JtuUb1oyaTdhtwm1HLMzbASE8KIQerDP4XSMq42_g>
 <xmx:7XHJZ75RDcmvLQ81UpQpEIiTsSz-zMKM3CpYnOBlGwV2Sn8JpFdVXg>
 <xmx:7nHJZxGYDUwvOU_oi-XcSaSgZWLMHl2IaTyZG8ZMp5Yw4b-MPPc349Um>
Feedback-ID: i16614472:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu,
 6 Mar 2025 04:59:08 -0500 (EST)
From: Pengji Zhang <me@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#76761: 31.0.50; Image icons from 'icons.el' could be
 accidentally dropped
In-Reply-To: <86wmd3oagj.fsf@HIDDEN>
References: <87frjr949t.fsf@HIDDEN> <86wmd3oagj.fsf@HIDDEN>
Date: Thu, 06 Mar 2025 17:59:06 +0800
Message-ID: <87bjuescnp.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 76761
Cc: 76761 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Eli Zaretskii <eliz@HIDDEN> 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'.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76761; Package emacs. Full text available.

Message received at 76761 <at> debbugs.gnu.org:


Received: (at 76761) by debbugs.gnu.org; 6 Mar 2025 09:48:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 06 04:48:27 2025
Received: from localhost ([127.0.0.1]:41591 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tq7q6-0002qg-M7
	for submit <at> debbugs.gnu.org; Thu, 06 Mar 2025 04:48:27 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:35394)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tq7q3-0002qP-IY
 for 76761 <at> debbugs.gnu.org; Thu, 06 Mar 2025 04:48:24 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tq7px-0003V3-QI; Thu, 06 Mar 2025 04:48:17 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=vyNpDgt1jnRdlYPUTGpP2CKrh8iOZOlJTo3p9w4SPT4=; b=QyZR4fWOdbpJ
 6fyrhX4bKOpL4IRvyeBNtXbXlgXXV3wMcApF9V1WfTaR+deEmrwz/fxUksPGLSuVyfLo84YJMwkKg
 cX4rgUMRUyflfogzZBps9QdI9toEw6eK5iWpPJRJteTHgIqgB2+zTgzU1bxy2jLpU6opIw8kaAfjZ
 CnVFPGzyAAQbomURKNTlP24SVdoTsDbd7lvpXg8C6YDm2/rh36SjwmIoLIn2BBOxVVVDe0TLI2wPU
 iKECEOHX+od9dUgoO6/bnnfaujnGIr7MTKIUczDE3WxG9C4FiOlWYFuEoKaHcOIDVvSDLuVJfazZX
 cU32+uSMWrMZ3iMlP+iLzA==;
Date: Thu, 06 Mar 2025 11:48:14 +0200
Message-Id: <86y0ximqw1.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: me@HIDDEN
In-Reply-To: <86wmd3oagj.fsf@HIDDEN> (message from Eli Zaretskii on Wed, 05
 Mar 2025 15:47:56 +0200)
Subject: Re: bug#76761: 31.0.50;
 Image icons from 'icons.el' could be accidentally dropped
References: <87frjr949t.fsf@HIDDEN> <86wmd3oagj.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76761
Cc: 76761 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: 76761 <at> debbugs.gnu.org
> Date: Wed, 05 Mar 2025 15:47:56 +0200
> From: Eli Zaretskii <eliz@HIDDEN>
> 
> > From: Pengji Zhang <me@HIDDEN>
> > Date: Wed, 05 Mar 2025 18:10:38 +0800
> > 
> > Currently in 'icons.el' image icons returned by 'icon-string' is a space
> > with a display property (see 'icons--create'). However, IMO it is common
> > to stripped spaces, and that means the icon could be accidentally
> > removed. For example,
> > 
> >   - Run 'emacs -Q'
> >   - Evaluate the following snippet:
> > 
> > --8<---------------cut here---------------start------------->8---
> > (require 'outline) ; for the icon
> > (setopt mode-line-compact t)
> > (setf global-mode-string
> >       '("" (:eval (icon-string 'outline-open)) " "))
> > (force-mode-line-update t)
> > --8<---------------cut here---------------end--------------->8---
> > 
> > Notice that the down arrow icon does not show at all in the mode line
> > due to 'mode-line-compact'.
> > 
> > I suppose an easy fix is to use a non-space character. WDYT?
> 
> 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.

Could you try the patch below and see if gives good results?

diff --git a/src/xdisp.c b/src/xdisp.c
index 6c623ab..5f82ea8 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -27612,15 +27612,28 @@ display_mode_line (struct window *w, enum face_id face_id, Lisp_Object format)
 	      int c = fetch_string_char_advance (mode_string, &i, &i_byte);
 	      if (c == ' ' && prev == ' ')
 		{
-		  display_string (NULL,
-				  Fsubstring (mode_string, make_fixnum (start),
-					      make_fixnum (i - 1)),
-				  Qnil, 0, 0, &it, 0, 0, 0,
-				  STRING_MULTIBYTE (mode_string));
-		  /* Skip past the rest of the space characters. */
-		  while (c == ' ' && i < SCHARS (mode_string))
-		      c = fetch_string_char_advance (mode_string, &i, &i_byte);
-		  start = i - 1;
+		  Lisp_Object prev_pos = make_fixnum (i - 1);
+
+		  if (NILP (Fget_text_property (prev_pos, Qdisplay,
+						mode_string)))
+		    {
+		      display_string (NULL,
+				      Fsubstring (mode_string,
+						  make_fixnum (start),
+						  prev_pos),
+				      Qnil, 0, 0, &it, 0, 0, 0,
+				      STRING_MULTIBYTE (mode_string));
+		      /* Skip past the rest of the space characters. */
+		      while (c == ' ' && i < SCHARS (mode_string)
+			     && NILP (Fget_text_property (make_fixnum (i),
+							  Qdisplay,
+							  mode_string)))
+			{
+			  c = fetch_string_char_advance (mode_string,
+							 &i, &i_byte);
+			}
+		      start = i - 1;
+		    }
 		}
 	      prev = c;
 	    }




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76761; Package emacs. Full text available.

Message received at 76761 <at> debbugs.gnu.org:


Received: (at 76761) by debbugs.gnu.org; 5 Mar 2025 13:48:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 08:48:07 2025
Received: from localhost ([127.0.0.1]:36195 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpp6V-0005Zf-2r
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 08:48:07 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10]:33034)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1tpp6S-0005Z6-CN
 for 76761 <at> debbugs.gnu.org; Wed, 05 Mar 2025 08:48:04 -0500
Received: from fencepost.gnu.org ([2001:470:142:3::e])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <eliz@HIDDEN>)
 id 1tpp6M-0007N1-RL; Wed, 05 Mar 2025 08:47:58 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date:
 mime-version; bh=8d4B1UIITKwp+tjDrdrT2XHy/on8i5wf6ZI6XwcDq5E=; b=Yl2IbM0tShsc
 6QhieYlYh1DeD59n5MGIGNqln+qCde8WI2ampcm0e1Pn0cGSnWAjckrcfvL2qHbHqiFIFTFcPGdeS
 71j8yK+cvyi+hk/Z+s/Wrq6nB09us1TmZ0jmccgtwzHHKYBvNlfpDmqkPRFLrSfRrSsptM576B3U4
 pwpQ1ENijOkGuFf282++asHRorFE6SaD6Y3PXDmYDy5MxQ4enrKO1WMZxvVoU3FMRM3dF8dlVy/RB
 jlpc5wsRAk3C9dKi2eqxKQJMebRaGaXpRJDVQLVpmBTyBATA8LAoqXcJ8JggIACibT1Fy8fiRqbzM
 +hr96usttBV5hDK4sg2u9A==;
Date: Wed, 05 Mar 2025 15:47:56 +0200
Message-Id: <86wmd3oagj.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Pengji Zhang <me@HIDDEN>
In-Reply-To: <87frjr949t.fsf@HIDDEN> (message from Pengji Zhang on Wed,
 05 Mar 2025 18:10:38 +0800)
Subject: Re: bug#76761: 31.0.50;
 Image icons from 'icons.el' could be accidentally dropped
References: <87frjr949t.fsf@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 76761
Cc: 76761 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: Pengji Zhang <me@HIDDEN>
> Date: Wed, 05 Mar 2025 18:10:38 +0800
> 
> Currently in 'icons.el' image icons returned by 'icon-string' is a space
> with a display property (see 'icons--create'). However, IMO it is common
> to stripped spaces, and that means the icon could be accidentally
> removed. For example,
> 
>   - Run 'emacs -Q'
>   - Evaluate the following snippet:
> 
> --8<---------------cut here---------------start------------->8---
> (require 'outline) ; for the icon
> (setopt mode-line-compact t)
> (setf global-mode-string
>       '("" (:eval (icon-string 'outline-open)) " "))
> (force-mode-line-update t)
> --8<---------------cut here---------------end--------------->8---
> 
> Notice that the down arrow icon does not show at all in the mode line
> due to 'mode-line-compact'.
> 
> I suppose an easy fix is to use a non-space character. WDYT?

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#76761; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 5 Mar 2025 10:10:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 05 05:10:56 2025
Received: from localhost ([127.0.0.1]:35481 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1tpliK-0005tV-BM
	for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 05:10:56 -0500
Received: from lists.gnu.org ([2001:470:142::17]:33614)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <me@HIDDEN>) id 1tpliG-0005tD-9R
 for submit <at> debbugs.gnu.org; Wed, 05 Mar 2025 05:10:55 -0500
Received: from eggs.gnu.org ([2001:470:142:3::10])
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1tpliA-00087o-7G
 for bug-gnu-emacs@HIDDEN; Wed, 05 Mar 2025 05:10:46 -0500
Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <me@HIDDEN>) id 1tpli7-0000qF-S7
 for bug-gnu-emacs@HIDDEN; Wed, 05 Mar 2025 05:10:45 -0500
Received: from phl-compute-12.internal (phl-compute-12.phl.internal
 [10.202.2.52])
 by mailfhigh.stl.internal (Postfix) with ESMTP id 2799425401FF
 for <bug-gnu-emacs@HIDDEN>; Wed,  5 Mar 2025 05:10:42 -0500 (EST)
Received: from phl-mailfrontend-02 ([10.202.2.163])
 by phl-compute-12.internal (MEProxy); Wed, 05 Mar 2025 05:10:42 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pengjiz.com; h=
 cc:content-type:content-type:date:date:from:from:in-reply-to
 :message-id:mime-version:reply-to:subject:subject:to:to; s=fm2;
 t=1741169442; x=1741255842; bh=vtpKHltY6YpZx8yDgf8W8i7ZMWsY91ud
 VDxnlPcxMoI=; b=avlNl/SCjRb2HZ6DYieP9echQsu8TCmGV2i3uz958PTupJNm
 q9WC13HbCSJl7XQ7YNJ76SxUyvVXODng+yWtxzLcfW8sKdNNmQYGp0grJhRtUeKM
 iDwXyYhxfPNsOypO+p8kBYkU9D4spH34pF/GM6LABwJY7eqDF3mfftj+rqPgwEF8
 qUZwRvWXYvZNSTklYsCzjUo0KHKFF/fDAvmqxpMFb6jtBYztlWqOiqYIaJOtGnhV
 qrJ9e7n7JolcVI4/3oAJeqmGOxCKMEaaRdbW90wWhK0b4w5Ey4iE6tryVL+HdxNA
 Yc96LDLz8rMHrNLuUZqRCT0rYIjXinDOt0Sc9Q==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-type:content-type:date:date
 :feedback-id:feedback-id:from:from:in-reply-to:message-id
 :mime-version:reply-to:subject:subject:to:to:x-me-proxy
 :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1741169442; x=
 1741255842; bh=vtpKHltY6YpZx8yDgf8W8i7ZMWsY91udVDxnlPcxMoI=; b=O
 aJJnQEzKb/T2SCd3zdJI8vsjev2/chTsiQf2WMU+N949Av+zpWVopI2pcHIyHgrC
 T5DRC5TEOBE6FzckOHpN3JUXuL4DCXuA5OVoIxMAByDiNOfjTReSvQ6iqQ+ty/ds
 PMxU2I91cOzHsXHGb9IGm6YKSZIGRTU2PkWYZG/CxMFVk5T9y6vKo8V3L7sO7Bih
 wDgIuTnRGZObzgYgTQ/GPbHU98fn7K16ThaeBqqMwEinJkR0zeJcOsbiGYKgQMnU
 ka4yJoc3hocTnfet5FSuY478N3bvnfAnGK+VYC6NBq1IqKZ5gbJ4XifkGUh2PudX
 2TfEmHFDX4wWspecYfu1g==
X-ME-Sender: <xms:ISPIZ9ZGGXK6jFZHOcwMJIL8q9zyUVQF8SDIuiuGebqNCT_30Xe6Pg>
 <xme:ISPIZ0aJpXOxERVb0_afJBGshMXCRuecQuwZveNsd3K7Bo89t2ZxdwR7VTGkCzbr-
 y0c9Lx3iE4LHEaL7SE>
X-ME-Received: <xmr:ISPIZ_-uuC7w40Ls1jy5IOQBAjPxXhByMQ34osX0nNWfKBcF9SqxvW59vQ>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgddutdegheegucetufdoteggodetrf
 dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv
 pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvf
 fufffkgggtsehttdertddttddtnecuhfhrohhmpefrvghnghhjihcukghhrghnghcuoehm
 vgesphgvnhhgjhhiiidrtghomheqnecuggftrfgrthhtvghrnheptdfhjeekueduleevff
 elffelhfeuueeufeehkeefteeuhfeiffethfdvhfevuedvnecuvehluhhsthgvrhfuihii
 vgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhgvsehpvghnghhjihiirdgtohhmpd
 hnsggprhgtphhtthhopedupdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegsuhhg
 qdhgnhhuqdgvmhgrtghssehgnhhurdhorhhg
X-ME-Proxy: <xmx:ISPIZ7oI04sjCcSppVrwp8ZZzyD46jLMHQCxPK6FKNRzRNJMUTCQxA>
 <xmx:ISPIZ4qXbbbULkZSJ7gMjIk0EmKpr_3YDfOq_qVKTbUovQebGiAv2g>
 <xmx:ISPIZxQe7gIC9dtg5edVJ4Vaxpane_C5Umstx_WGMUPaJA3-vJWw5w>
 <xmx:ISPIZwpYdrNebzTN200b8eoaMOcbl79P5d13vaN2K6joR-1uur9EtA>
 <xmx:ISPIZ1Cx2Pz9IsDPtHNGwMqVizDRCm6L7zXpvjK5Cg1rt9kbx9zXH6Qd>
Feedback-ID: i16614472:Fastmail
Received: by mail.messagingengine.com (Postfix) with ESMTPA for
 <bug-gnu-emacs@HIDDEN>; Wed, 5 Mar 2025 05:10:40 -0500 (EST)
From: Pengji Zhang <me@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Image icons from 'icons.el' could be accidentally dropped
Date: Wed, 05 Mar 2025 18:10:38 +0800
Message-ID: <87frjr949t.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=202.12.124.154; envelope-from=me@HIDDEN;
 helo=fhigh-b3-smtp.messagingengine.com
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001,
 RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 0.7 (/)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.3 (/)

Greetings!

Currently in 'icons.el' image icons returned by 'icon-string' is a space
with a display property (see 'icons--create'). However, IMO it is common
to stripped spaces, and that means the icon could be accidentally
removed. For example,

  - Run 'emacs -Q'
  - Evaluate the following snippet:

--8<---------------cut here---------------start------------->8---
(require 'outline) ; for the icon
(setopt mode-line-compact t)
(setf global-mode-string
      '("" (:eval (icon-string 'outline-open)) " "))
(force-mode-line-update t)
--8<---------------cut here---------------end--------------->8---

Notice that the down arrow icon does not show at all in the mode line
due to 'mode-line-compact'.

I suppose an easy fix is to use a non-space character. WDYT?

Thanks!

In GNU Emacs 31.0.50 (build 71, x86_64-pc-linux-gnu, GTK+ Version
3.24.48, cairo version 1.18.2)
Repository revision: fe7a8c92be6269f8fc7933eb6c190178839d0f8a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Arch Linux

Configured using:
 'configure --disable-build-details'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ JPEG
LCMS2 LIBOTF LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP X11 XDBE XIM XINERAMA XINPUT2 XPM
XRANDR GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  tab-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  minibuffer-regexp-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug lisp-mnt message mailcap yank-media puny
dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068
epg-config gnus-util text-property-search time-date mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils auth-source
cl-seq eieio eieio-core cl-macs password-cache json map byte-opt gv
subr-x comp-run bytecomp byte-compile comp-common rx icons cl-loaddefs
cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd touch-screen tool-bar dnd fontset image regexp-opt
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads dbusbind inotify lcms2 dynamic-setting system-font-setting
font-render-setting cairo gtk x-toolkit xinput2 x multi-tty move-toolbar
make-network-process tty-child-frames native-compile emacs)

Memory information:
((conses 16 73089 11379) (symbols 48 7060 0) (strings 32 18927 2897)
 (string-bytes 1 596210) (vectors 16 12730)
 (vector-slots 8 167990 9957) (floats 8 28 18) (intervals 56 392 87)
 (buffers 992 12))




Acknowledgement sent to Pengji Zhang <me@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#76761; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Thu, 6 Mar 2025 12:30:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.