GNU bug report logs - #65105
Reusing the same string as 'display on consecutive characters evades display

Previous Next

Package: emacs;

Reported by: JD Smith <jdtsmith <at> gmail.com>

Date: Sat, 5 Aug 2023 18:36:01 UTC

Severity: normal

Tags: notabug

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: JD Smith <jdtsmith <at> gmail.com>
Subject: bug#65105: closed (Re: bug#65105: Reusing the same string as
 'display on consecutive characters evades display)
Date: Sun, 06 Aug 2023 04:56:02 +0000
[Message part 1 (text/plain, inline)]
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 65105 <at> debbugs.gnu.org.

-- 
65105: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=65105
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Eli Zaretskii <eliz <at> gnu.org>
To: JD Smith <jdtsmith <at> gmail.com>
Cc: dmitry <at> gutov.dev, 65105-done <at> debbugs.gnu.org
Subject: Re: bug#65105: Reusing the same string as 'display on consecutive
 characters evades display
Date: Sun, 06 Aug 2023 07:55:25 +0300
> From: JD Smith <jdtsmith <at> gmail.com>
> Date: Sat, 5 Aug 2023 18:49:11 -0400
> Cc: Eli Zaretskii <eliz <at> gnu.org>,
>  65105 <at> debbugs.gnu.org
> 
> That’s probably the right approach.  Or even simpler, allocate two identical strings and alternate.  Thanks.

And with that, I'm closing this bug.

[Message part 3 (message/rfc822, inline)]
From: JD Smith <jdtsmith <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Reusing the same string as 'display on consecutive characters evades
 display
Date: Sat, 5 Aug 2023 14:35:23 -0400
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.




This bug report was last modified 1 year and 290 days ago.

Previous Next


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