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: 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



reply via email to

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