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: Pip Cet
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Wed, 03 Jun 2020 22:41:54 +0000
User-agent: Gnus/5.13 (Gnus v5.13)

João Távora <joaotavora@gmail.com> writes:

> Hi Paul,
>
> After a lengthy git bisect, I discovered that this commit is responsible
> for breaking a very big part of my SLY extension, a Common Lisp IDE for
> Emacs.  The reason is this change to make-text-button
>
> -    (when (stringp beg)
> -      (setq object beg beg 0 end (length object)))
> +      (setq object (copy-sequence beg) beg 0 end (length object)))
>
> I don't pretend to understand the reason for the change, but I know it
> hasn't worked like this for a long time (SLY came about for Emacs 24.3).,
>
> I didn't investigate much, but SLY has a lot of
>
>    (insert (sly-make-action-button "[SOMEBUTTON]" ..))
>
> and sly-make-action-button is
>
>    (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.

Attachment: 0001-adjust-to-Emacs-28-change.patch
Description: Text Data


reply via email to

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