Subject: bug#65105: closed (Re: bug#65105: Reusing the same string as 'display on consecutive characters evades display)

From: [email-masked] (GNU bug Tracking System)
Date: Sun, 06 Aug 2023 04:56:02 +0000

Your bug report

#65105: Reusing the same string as 'display on consecutive characters evades display

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
65105: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65105
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#65105: Reusing the same string as 'display on consecutive characters evades display
From: Eli Zaretskii <[email-masked]>
To: JD Smith <[email-masked]>
Cc: [email-masked], [email-masked]
Date: Sun, 06 Aug 2023 07:55:25 +0300
List-Id: <debbugs-submit.debbugs.gnu.org>

> From: JD Smith <[email-masked]>
> Date: Sat, 5 Aug 2023 18:49:11 -0400
> Cc: Eli Zaretskii <[email-masked]>,
>  [email-masked]
> 
> That’s probably the right approach.  Or even simpler, allocate two identical strings and alternate.  Thanks.

And with that, I'm closing this bug.

Subject: Reusing the same string as 'display on consecutive characters evades display
From: JD Smith <[email-masked]>
To: [email-masked]
Date: Sat, 5 Aug 2023 14:35:23 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

Evaluate:

(let ((s1 "test1")
      (s2 "test2"))
  (insert "\n"
          (propertize " " 'display s1)
          (propertize " " 'display s1)
          (propertize " " 'display s2)
          (propertize " " 'display s1)))

The first space display does not take effect, since the s1 string is used for two consecutive characters.  This has a practical impact for font-lock backends that use the ‘display text-property and would like to minimize string allocation.  

Tested Emacs 27/28/29.