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


View this message in rfc822 format

From: dalanicolai <dalanicolai <at> gmail.com>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 61735 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: bug#61735: 29.0.50; String object in margin not associated correctly with buffer text
Date: Thu, 23 Feb 2023 20:57:20 +0100
[Message part 1 (text/plain, inline)]
Thanks for that explanation. Indeed, I found it hard to find a thorough
explanation anywhere. Also, thanks for reminding me about propertize.


On Thu, 23 Feb 2023 at 19:36, Stefan Monnier <monnier <at> iro.umontreal.ca>
wrote:

> > 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
>
>
[Message part 2 (text/html, inline)]

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.