From 6dad339f064df180e8f2c6257ffb53a6f341c4ec Mon Sep 17 00:00:00 2001 From: Paul Eggert 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