[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 31395511: "Don’t attempt to modify constant strings"
From: |
Basil L. Contovounesios |
Subject: |
Re: 31395511: "Don’t attempt to modify constant strings" |
Date: |
Thu, 04 Jun 2020 00:08:58 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
Pip Cet <pipcet@gmail.com> writes:
> João Távora <joaotavora@gmail.com> writes:
>
>> (defun sly-make-action-button (label action &rest props)
>> (apply #'sly--make-text-button
>> label nil :type 'sly-action
>> 'action action
>> 'mouse-action action
>> props)
>> label)
>
> I think you want
> (defun sly-make-action-button (label action &rest props)
> (apply #'sly--make-text-button
> label nil :type 'sly-action
> 'action action
> 'mouse-action action
> props))
>
> instead, since the new function returns a copy of label rather than the
> string passed in.
Note that doing that would break compatibility with Emacs < 24.3, which
is when make-text-button started returning the modified string object,
in case that's important to you.
--
Basil
- Re: 31395511: "Don’t attempt to modify constant strings", João Távora, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings", Paul Eggert, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings", Pip Cet, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings",
Basil L. Contovounesios <=
- Re: 31395511: "Don’t attempt to modify constant strings", João Távora, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings", Paul Eggert, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings", Paul Eggert, 2020/06/03
- Re: 31395511: "Don’t attempt to modify constant strings", Pip Cet, 2020/06/04
- Re: 31395511: "Don’t attempt to modify constant strings", Basil L. Contovounesios, 2020/06/04
- Re: 31395511: "Don’t attempt to modify constant strings", Paul Eggert, 2020/06/04
- Re: 31395511: "Don’t attempt to modify constant strings", João Távora, 2020/06/04
- Re: 31395511: "Don’t attempt to modify constant strings", Paul Eggert, 2020/06/04
- RE: 31395511: "Don’t attempt to modify constant strings", Drew Adams, 2020/06/04