Eliminate some mutation of program constants

* lisp/foldout.el:
* lisp/gnus/mml2015.el (mml2015-epg-key-image-to-string):
* lisp/international/ja-dic-cnv.el (skkdic-set-postfix)
(skkdic-set-prefix):
* lisp/international/quail.el (quail-insert-kbd-layout):
* lisp/mail/rmail.el (rmail-set-attribute-1):
* lisp/net/tramp.el (tramp-handle-memory-info):
* lisp/org/org-macs.el (org-replace-escapes):
Work on newly created objects, or use non-destructive operations.
This commit is contained in:
Mattias Engdegård 2023-05-17 10:56:44 +02:00
parent 6cb963b73c
commit 670174a6d5
7 changed files with 8 additions and 9 deletions

View file

@ -229,7 +229,7 @@ An end marker of nil means the fold ends after (point-max).")
(error "Can't find outline-minor-mode in minor-mode-alist"))
;; slip our fold announcement into the list
(setcdr outl-entry (nconc foldout-entry (cdr outl-entry)))))
(setcdr outl-entry (append foldout-entry (cdr outl-entry)))))

View file

@ -752,7 +752,7 @@ If set, it overrides the setting of `mml2015-sign-with-sender'."
(if (not key-image)
""
(condition-case nil
(let ((result " "))
(let ((result (copy-sequence " ")))
(put-text-property
1 2 'display
(gnus-rescale-image key-image

View file

@ -484,7 +484,7 @@ To get complete usage, invoke:
(defmacro skkdic-set-postfix (&rest entries)
`(defconst skkdic-postfix
',(let ((l entries)
(map '(nil))
(map (list nil))
(longest 1)
len entry)
(while l
@ -507,7 +507,7 @@ To get complete usage, invoke:
(defmacro skkdic-set-prefix (&rest entries)
`(defconst skkdic-prefix
',(let ((l entries)
(map '(nil))
(map (list nil))
(longest 1)
len entry)
(while l

View file

@ -804,13 +804,12 @@ The format of KBD-LAYOUT is the same as `quail-keyboard-layout'."
(setq i (1+ i)))
(let ((pos (point))
(bar "|")
(bar (propertize "|" 'face 'bold))
lower upper row)
;; Make table without horizontal lines. Each column for a key
;; has the form "| LU |" where L is for lower key and U is
;; for a upper key. If width of L (U) is greater than 1,
;; preceding (following) space is not inserted.
(put-text-property 0 1 'face 'bold bar)
(setq i 0)
(while (< i quail-keyboard-layout-len)
(when (= (% i 30) 0)

View file

@ -2285,7 +2285,7 @@ significant attribute change was made."
(insert value)))
;; Otherwise add a header line to record the attributes and set
;; all but this one to no.
(let ((header-value "--------"))
(let ((header-value (copy-sequence "--------")))
(aset header-value attr value)
(goto-char (if limit (1- limit) (point-max)))
(setq altered (/= value ?-))

View file

@ -5142,7 +5142,7 @@ support symbolic links."
(defun tramp-handle-memory-info ()
"Like `memory-info' for Tramp files."
(let ((result '(0 0 0 0))
(let ((result (list 0 0 0 0))
process-file-side-effects)
(with-temp-buffer
(cond

View file

@ -1288,7 +1288,7 @@ so values can contain further %-escapes if they are define later in TABLE."
(setq re (concat "%-?[0-9.]*" (substring (car e) 1)))
(when (and (cdr e) (string-match re (cdr e)))
(let ((sref (substring (cdr e) (match-beginning 0) (match-end 0)))
(safe "SREF"))
(safe (copy-sequence "SREF")))
(add-text-properties 0 3 (list 'sref sref) safe)
(setcdr e (replace-match safe t t (cdr e)))))
(while (string-match re string)