From: Paul Eggert <eggert@cs.ucla.edu>
To: "João Távora" <joaotavora@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Wed, 3 Jun 2020 15:41:01 -0700 [thread overview]
Message-ID: <1291ef4a-3a47-3990-9b5f-ec15bb72eb73@cs.ucla.edu> (raw)
In-Reply-To: <871rmvn7ge.fsf@gmail.com>
[-- Attachment #1: Type: text/plain, Size: 288 bytes --]
On 6/3/20 2:52 PM, João Távora wrote:
> Not sure where the problem lies but every button inserted by SLY is now
> just plain text.
It's because I messed up in that part of the patch. Thanks for reporting the
bug. I installed the attached patch into master; please give it a try.
[-- Attachment #2: 0001-Fix-make-text-button-bug-with-string-copy.patch --]
[-- Type: text/x-patch, Size: 1315 bytes --]
From 6dad339f064df180e8f2c6257ffb53a6f341c4ec Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 3 Jun 2020 15:39:29 -0700
Subject: [PATCH] Fix make-text-button bug with string copy
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* lisp/button.el (make-text-button): Use the copy of BEG
uniformly, instead of in just one place. This fixes a typo
introduced in 2020-05-17T05:23:28Z!eggert@cs.ucla.edu.
Problem reported by João Távora in:
https://lists.gnu.org/r/emacs-devel/2020-06/msg00117.html
---
lisp/button.el | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lisp/button.el b/lisp/button.el
index f969a03cb0..a91b0482ac 100644
--- a/lisp/button.el
+++ b/lisp/button.el
@@ -349,7 +349,8 @@ make-text-button
(or (plist-member properties 'type)
(plist-member properties :type))))
(when (stringp beg)
- (setq object (copy-sequence beg) beg 0 end (length object)))
+ (setq beg (copy-sequence beg)) ;; In case BEG is not mutable.
+ (setq object beg beg 0 end (length object)))
;; Disallow setting the `category' property directly.
(when (plist-get properties 'category)
(error "Button `category' property may not be set directly"))
--
2.17.1
next prev parent reply other threads:[~2020-06-03 22:41 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-03 21:52 31395511: "Don’t attempt to modify constant strings" João Távora
2020-06-03 22:41 ` Paul Eggert [this message]
2020-06-03 22:52 ` Pip Cet
2020-06-03 23:20 ` Paul Eggert
2020-06-03 23:20 ` Basil L. Contovounesios
2020-06-03 22:41 ` Pip Cet
2020-06-03 23:08 ` Basil L. Contovounesios
2020-06-03 23:31 ` Basil L. Contovounesios
2020-06-03 23:48 ` João Távora
2020-06-04 0:43 ` Paul Eggert
2020-06-04 1:19 ` Paul Eggert
2020-06-04 7:26 ` Pip Cet
2020-06-04 11:11 ` Basil L. Contovounesios
2020-06-04 19:46 ` Paul Eggert
2020-06-04 20:25 ` João Távora
2020-06-04 20:29 ` Paul Eggert
2020-06-04 21:21 ` Drew Adams
2020-06-04 20:43 ` Pip Cet
2020-06-04 21:27 ` Stefan Monnier
2020-06-04 21:42 ` Pip Cet
2020-06-04 23:10 ` Paul Eggert
2020-06-05 2:09 ` Clément Pit-Claudel
2020-06-05 6:44 ` Paul Eggert
2020-06-05 12:44 ` Stefan Monnier
2020-06-05 17:01 ` Drew Adams
2020-06-05 9:48 ` Pip Cet
2020-06-05 18:37 ` Paul Eggert
2020-06-04 22:33 ` Basil L. Contovounesios
2020-06-05 15:25 ` João Távora
2020-06-05 17:14 ` Dmitry Gutov
2020-06-05 23:19 ` João Távora
2020-06-05 23:32 ` Dmitry Gutov
2020-06-06 1:34 ` FW: " Drew Adams
2020-06-06 0:23 ` Drew Adams
2020-06-06 1:43 ` Paul Eggert
2020-06-06 4:06 ` Richard Stallman
2020-06-06 11:41 ` João Távora
2020-06-06 11:47 ` João Távora
2020-06-04 4:38 ` Pip Cet
2020-06-04 9:31 ` João Távora
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1291ef4a-3a47-3990-9b5f-ec15bb72eb73@cs.ucla.edu \
--to=eggert@cs.ucla.edu \
--cc=emacs-devel@gnu.org \
--cc=joaotavora@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).