emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 31395511: "Don’t attempt to modify constant strings"


From: Paul Eggert
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Fri, 5 Jun 2020 11:37:29 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 6/5/20 2:48 AM, Pip Cet wrote:

>> they can be coalesced, or retained, or put into read-only memory.
> 
> Really? Is there code in Emacs (other than purecopy, which isn't the
> problem here) that does any of that today?

Sure, the byte-compiler coalesces strings with identical contents. If you change
one you change them all. And some built-in strings are put into read-only memory
now.

> if text properties aren't part of "the string itself", they can be
> given text properties.

I was thinking of just mimicking the traditional Elisp behavior that you can't
give modify the text properties of readonly strings. Of course if we want to
allow that sort of thing we could - but it sounds to me like a feature that's
more trouble than it's worth. I doubt there's a much legacy code out there that
depends on modifying text properties of string constants, since it wasn't
allowed until quite recently and was allowed more as an accident than anything 
else.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]