GNU bug report logs - #61735
29.0.50; String object in margin not associated correctly with buffer text

Previous Next

Package: emacs;

Reported by: dalanicolai <dalanicolai <at> gmail.com>

Date: Thu, 23 Feb 2023 16:34:02 UTC

Severity: normal

Found in version 29.0.50

Done: Stefan Kangas <stefankangas <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 61735 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: dalanicolai <dalanicolai <at> gmail.com>
Cc: 61735 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#61735: 29.0.50; String object in margin not associated
 correctly with buffer text
Date: Thu, 23 Feb 2023 13:36:44 -0500
> Indeed, I assumed that I was creating new strings because (eq " " " ")
> is nil.

Your test can return nil even if new strings aren't created at runtime
(e.g. because each source code string gets its own runtime string).

It may be nil in your test, but it may also return t (I think if you
byte-compile your test it will return t).

>> >         (let ((s " "))

Here you have a single " " string in your source code.  And no it's not
recreated each time, it will be the same one reused everytime (and
modified by `put-text-property`).

You can use `propertize` instead.


        Stefan





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

Previous Next


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