Don’t attempt to modify constant strings

* lisp/bookmark.el (bookmark-bmenu-set-header):
Use copy-sequence instead of concat, for clarity.
Also, the byte-compiler optimizes (concat "a" "b") into "ab".
* lisp/button.el (make-text-button):
* test/lisp/erc/erc-track-tests.el (erc-track--erc-faces-in):
* test/lisp/password-cache-tests.el:
(password-cache-tests-add-and-remove)
(password-cache-tests-read-from-cache)
(password-cache-tests-in-cache-p, password-cache-tests-read)
(password-cache-tests-reset)
(password-cache-tests-add/expires-key)
(password-cache-tests-no-password-cache):
Don’t attempt to modify constant strings.
* lisp/progmodes/elisp-mode.el (elisp--xref-format)
(elisp--xref-format-extra):
Don’t attempt to modify constant strings via put-text-property.
* test/lisp/emacs-lisp/cl-macs-tests.el (cl-macs-loop-across-ref):
Don’t attempt to modify constant vectors or strings.
This commit is contained in:
Paul Eggert 2020-05-16 22:23:28 -07:00
parent 1fc4e3fb3f
commit 313955110b
7 changed files with 21 additions and 21 deletions

View file

@ -425,7 +425,9 @@ collection clause."
'(2 3 4 5 6))))
(ert-deftest cl-macs-loop-across-ref ()
(should (equal (cl-loop with my-vec = ["one" "two" "three"]
(should (equal (cl-loop with my-vec = (vector (cl-copy-seq "one")
(cl-copy-seq "two")
(cl-copy-seq "three"))
for x across-ref my-vec
do (setf (aref x 0) (upcase (aref x 0)))
finally return my-vec)