[Top][All Lists]

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

Re: master f51f963: Fix some side-effecting uses of make-text-button

From: Basil L. Contovounesios
Subject: Re: master f51f963: Fix some side-effecting uses of make-text-button
Date: Fri, 05 Jun 2020 14:51:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Pip Cet <pipcet@gmail.com> writes:


> It would not be a quick bug fix for code that uses (propertize "string"
> 'a 'b).

propertize returns a copy of its argument, so it's not problematic in
this context.

> In particular, I'm not convinced code like that is buggy at all. It's
> true that it will fail under certain conditions (the string constant is
> used again in the same function, the function is byte compiled, that
> sort of thing), and it's true there are better ways of doing that, but
> is that reason enough to off-handedly ban all such code?


My only concern with destructively modifying string literals as in the
(make-text-button "here" ...) example is that it can "pollute" that
string literal for all of its users, which is both "rude" and
unnecessary in this case.  I simply find it cleaner, less intrusive, and
less surprising to modify only one's own copy of a string in such a
trivial case.  I'm not personally concerned with crashes, theoretical
purity or mutability, or anything like that; for that I defer to you,
Paul, and other experts.


reply via email to

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