diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-06-03 15:39:29 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-06-03 15:39:51 -0700 |
commit | 6dad339f064df180e8f2c6257ffb53a6f341c4ec (patch) | |
tree | 40875e832a4450549920204a36de91e2863a60ba /lisp/button.el | |
parent | bd20af2d41f24c9e59acb867a1a4485284cb2a65 (diff) | |
download | emacs-6dad339f064df180e8f2c6257ffb53a6f341c4ec.tar.gz emacs-6dad339f064df180e8f2c6257ffb53a6f341c4ec.tar.bz2 emacs-6dad339f064df180e8f2c6257ffb53a6f341c4ec.zip |
Fix make-text-button bug with string copy
* 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
Diffstat (limited to 'lisp/button.el')
-rw-r--r-- | lisp/button.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/button.el b/lisp/button.el index f969a03cb02..a91b0482acd 100644 --- a/lisp/button.el +++ b/lisp/button.el @@ -349,7 +349,8 @@ Also see `insert-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")) |