From: dalanicolai <dalanicolai@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 61735@debbugs.gnu.org, Eli Zaretskii <eliz@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 [thread overview]
Message-ID: <CACJP=3naj0H+gctA3fuPM_2oouo4y_LWvadnoYPDtp7Mdqc5ag@mail.gmail.com> (raw)
In-Reply-To: <jwvbklkfczg.fsf-monnier+emacs@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
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@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
>
>
[-- Attachment #2: Type: text/html, Size: 1300 bytes --]
next prev parent reply other threads:[~2023-02-23 19:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-23 16:32 bug#61735: 29.0.50; String object in margin not associated correctly with buffer text dalanicolai
2023-02-23 17:45 ` Eli Zaretskii
2023-02-23 18:05 ` dalanicolai
2023-02-23 18:36 ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-02-23 19:57 ` dalanicolai [this message]
2023-09-12 1:06 ` Stefan Kangas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CACJP=3naj0H+gctA3fuPM_2oouo4y_LWvadnoYPDtp7Mdqc5ag@mail.gmail.com' \
--to=dalanicolai@gmail.com \
--cc=61735@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=monnier@iro.umontreal.ca \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.