diff options
| author | Paul Eggert | 2020-05-16 17:04:15 -0700 |
|---|---|---|
| committer | Paul Eggert | 2020-05-16 17:05:37 -0700 |
| commit | c7bc28bf038e08fcc03e5dc96cd762af06b34e09 (patch) | |
| tree | 378ddd85e5549bddeb5642314c8ac1627743e324 /lisp | |
| parent | a6ebca21b349ccfffdc0d4b84578d4c7a0f3ee22 (diff) | |
| download | emacs-c7bc28bf038e08fcc03e5dc96cd762af06b34e09.tar.gz emacs-c7bc28bf038e08fcc03e5dc96cd762af06b34e09.zip | |
Don’t attempt to modify constant conses
From a patch privately suggested by Mattias Engdegård on 2020-05-11
in a followup to Bug#40671.
* admin/charsets/cp51932.awk:
* admin/charsets/eucjp-ms.awk:
Generate code that does not modify constant conses.
* doc/misc/emacs-mime.texi (Encoding Customization):
* lisp/emacs-lisp/byte-opt.el (byte-compile-side-effect-free-ops):
* lisp/frameset.el (frameset-persistent-filter-alist):
* lisp/gnus/gnus-sum.el (gnus-article-mode-line-format-alist):
Use append instead of nconc.
* lisp/language/japanese.el (japanese-ucs-cp932-to-jis-map)
(jisx0213-to-unicode):
Use mapcar instead of mapc.
* lisp/language/lao-util.el (lao-transcription-consonant-alist)
(lao-transcription-vowel-alist):
* lisp/language/tibetan.el (tibetan-subjoined-transcription-alist):
Use copy-sequence.
* test/src/fns-tests.el (fns-tests-nreverse):
(fns-tests-sort, fns-tests-collate-sort)
(fns-tests-string-version-lessp, fns-tests-mapcan):
Use copy-sequence, vector, and list.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/emacs-lisp/byte-opt.el | 2 | ||||
| -rw-r--r-- | lisp/frameset.el | 12 | ||||
| -rw-r--r-- | lisp/gnus/gnus-sum.el | 6 | ||||
| -rw-r--r-- | lisp/language/japanese.el | 10 | ||||
| -rw-r--r-- | lisp/language/lao-util.el | 16 | ||||
| -rw-r--r-- | lisp/language/tibetan.el | 8 |
6 files changed, 30 insertions, 24 deletions
diff --git a/lisp/emacs-lisp/byte-opt.el b/lisp/emacs-lisp/byte-opt.el index 4f72251aed5..62b82e4f32a 100644 --- a/lisp/emacs-lisp/byte-opt.el +++ b/lisp/emacs-lisp/byte-opt.el | |||
| @@ -1509,7 +1509,7 @@ | |||
| 1509 | byte-current-buffer byte-stack-ref)) | 1509 | byte-current-buffer byte-stack-ref)) |
| 1510 | 1510 | ||
| 1511 | (defconst byte-compile-side-effect-free-ops | 1511 | (defconst byte-compile-side-effect-free-ops |
| 1512 | (nconc | 1512 | (append |
| 1513 | '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref | 1513 | '(byte-varref byte-nth byte-memq byte-car byte-cdr byte-length byte-aref |
| 1514 | byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 | 1514 | byte-symbol-value byte-get byte-concat2 byte-concat3 byte-sub1 byte-add1 |
| 1515 | byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate | 1515 | byte-eqlsign byte-gtr byte-lss byte-leq byte-geq byte-diff byte-negate |
diff --git a/lisp/frameset.el b/lisp/frameset.el index 10c6914f52d..0462d776c0e 100644 --- a/lisp/frameset.el +++ b/lisp/frameset.el | |||
| @@ -396,17 +396,17 @@ Properties can be set with | |||
| 396 | ;; or, if you're only changing a few items, | 396 | ;; or, if you're only changing a few items, |
| 397 | ;; | 397 | ;; |
| 398 | ;; (defvar my-filter-alist | 398 | ;; (defvar my-filter-alist |
| 399 | ;; (nconc '((my-param1 . :never) | 399 | ;; (append '((my-param1 . :never) |
| 400 | ;; (my-param2 . my-filtering-function)) | 400 | ;; (my-param2 . my-filtering-function)) |
| 401 | ;; frameset-filter-alist) | 401 | ;; frameset-filter-alist) |
| 402 | ;; "My brief customized parameter filter alist.") | 402 | ;; "My brief customized parameter filter alist.") |
| 403 | ;; | 403 | ;; |
| 404 | ;; and pass it to the FILTER arg of the save/restore functions, | 404 | ;; and pass it to the FILTER arg of the save/restore functions, |
| 405 | ;; ALWAYS taking care of not modifying the original lists; if you're | 405 | ;; ALWAYS taking care of not modifying the original lists; if you're |
| 406 | ;; going to do any modifying of my-filter-alist, please use | 406 | ;; going to do any modifying of my-filter-alist, please use |
| 407 | ;; | 407 | ;; |
| 408 | ;; (nconc '((my-param1 . :never) ...) | 408 | ;; (append '((my-param1 . :never) ...) |
| 409 | ;; (copy-sequence frameset-filter-alist)) | 409 | ;; (copy-sequence frameset-filter-alist)) |
| 410 | ;; | 410 | ;; |
| 411 | ;; One thing you shouldn't forget is that they are alists, so searching | 411 | ;; One thing you shouldn't forget is that they are alists, so searching |
| 412 | ;; in them is sequential. If you just want to change the default of | 412 | ;; in them is sequential. If you just want to change the default of |
| @@ -445,7 +445,7 @@ DO NOT MODIFY. See `frameset-filter-alist' for a full description.") | |||
| 445 | 445 | ||
| 446 | ;;;###autoload | 446 | ;;;###autoload |
| 447 | (defvar frameset-persistent-filter-alist | 447 | (defvar frameset-persistent-filter-alist |
| 448 | (nconc | 448 | (append |
| 449 | '((background-color . frameset-filter-sanitize-color) | 449 | '((background-color . frameset-filter-sanitize-color) |
| 450 | (buffer-list . :never) | 450 | (buffer-list . :never) |
| 451 | (buffer-predicate . :never) | 451 | (buffer-predicate . :never) |
diff --git a/lisp/gnus/gnus-sum.el b/lisp/gnus/gnus-sum.el index 6f367692ddd..341f04ad772 100644 --- a/lisp/gnus/gnus-sum.el +++ b/lisp/gnus/gnus-sum.el | |||
| @@ -1501,9 +1501,9 @@ the type of the variable (string, integer, character, etc).") | |||
| 1501 | 1501 | ||
| 1502 | ;; This is here rather than in gnus-art for compilation reasons. | 1502 | ;; This is here rather than in gnus-art for compilation reasons. |
| 1503 | (defvar gnus-article-mode-line-format-alist | 1503 | (defvar gnus-article-mode-line-format-alist |
| 1504 | (nconc '((?w (gnus-article-wash-status) ?s) | 1504 | (append '((?w (gnus-article-wash-status) ?s) |
| 1505 | (?m (gnus-article-mime-part-status) ?s)) | 1505 | (?m (gnus-article-mime-part-status) ?s)) |
| 1506 | gnus-summary-mode-line-format-alist)) | 1506 | gnus-summary-mode-line-format-alist)) |
| 1507 | 1507 | ||
| 1508 | (defvar gnus-last-search-regexp nil | 1508 | (defvar gnus-last-search-regexp nil |
| 1509 | "Default regexp for article search command.") | 1509 | "Default regexp for article search command.") |
diff --git a/lisp/language/japanese.el b/lisp/language/japanese.el index d77efa48c9b..9a99245dfde 100644 --- a/lisp/language/japanese.el +++ b/lisp/language/japanese.el | |||
| @@ -82,9 +82,7 @@ | |||
| 82 | (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE | 82 | (#x00A6 . #xFFE4) ; BROKEN LINE FULLWIDTH BROKEN LINE |
| 83 | ))) | 83 | ))) |
| 84 | (define-translation-table 'japanese-ucs-jis-to-cp932-map map) | 84 | (define-translation-table 'japanese-ucs-jis-to-cp932-map map) |
| 85 | (mapc #'(lambda (x) (let ((tmp (car x))) | 85 | (setq map (mapcar (lambda (x) (cons (cdr x) (car x))) map)) |
| 86 | (setcar x (cdr x)) (setcdr x tmp))) | ||
| 87 | map) | ||
| 88 | (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) | 86 | (define-translation-table 'japanese-ucs-cp932-to-jis-map map)) |
| 89 | 87 | ||
| 90 | ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) | 88 | ;; U+2014 (EM DASH) vs U+2015 (HORIZONTAL BAR) |
| @@ -241,8 +239,10 @@ eucJP-ms is defined in <http://www.opengroup.or.jp/jvc/cde/appendix.html>." | |||
| 241 | (#x2b65 . [#x02E9 #x02E5]) | 239 | (#x2b65 . [#x02E9 #x02E5]) |
| 242 | (#x2b66 . [#x02E5 #x02E9]))) | 240 | (#x2b66 . [#x02E5 #x02E9]))) |
| 243 | table) | 241 | table) |
| 244 | (dolist (elt map) | 242 | (setq map |
| 245 | (setcar elt (decode-char 'japanese-jisx0213-1 (car elt)))) | 243 | (mapcar (lambda (x) (cons (decode-char 'japanese-jisx0213-1 (car x)) |
| 244 | (cdr x))) | ||
| 245 | map)) | ||
| 246 | (setq table (make-translation-table-from-alist map)) | 246 | (setq table (make-translation-table-from-alist map)) |
| 247 | (define-translation-table 'jisx0213-to-unicode table) | 247 | (define-translation-table 'jisx0213-to-unicode table) |
| 248 | (define-translation-table 'unicode-to-jisx0213 | 248 | (define-translation-table 'unicode-to-jisx0213 |
diff --git a/lisp/language/lao-util.el b/lisp/language/lao-util.el index a20aecee421..fa4c2f7f891 100644 --- a/lisp/language/lao-util.el +++ b/lisp/language/lao-util.el | |||
| @@ -183,7 +183,9 @@ | |||
| 183 | ;; Semi-vowel-sign-lo and lower vowels are put under the letter. | 183 | ;; Semi-vowel-sign-lo and lower vowels are put under the letter. |
| 184 | 184 | ||
| 185 | (defconst lao-transcription-consonant-alist | 185 | (defconst lao-transcription-consonant-alist |
| 186 | (sort '(;; single consonants | 186 | (sort |
| 187 | (copy-sequence | ||
| 188 | '(;; single consonants | ||
| 187 | ("k" . "ກ") | 189 | ("k" . "ກ") |
| 188 | ("kh" . "ຂ") | 190 | ("kh" . "ຂ") |
| 189 | ("qh" . "ຄ") | 191 | ("qh" . "ຄ") |
| @@ -223,14 +225,16 @@ | |||
| 223 | ("hy" . ["ຫຍ"]) | 225 | ("hy" . ["ຫຍ"]) |
| 224 | ("hn" . ["ຫນ"]) | 226 | ("hn" . ["ຫນ"]) |
| 225 | ("hm" . ["ຫມ"]) | 227 | ("hm" . ["ຫມ"]) |
| 226 | ) | 228 | )) |
| 227 | (function (lambda (x y) (> (length (car x)) (length (car y))))))) | 229 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 228 | 230 | ||
| 229 | (defconst lao-transcription-semi-vowel-alist | 231 | (defconst lao-transcription-semi-vowel-alist |
| 230 | '(("r" . "ຼ"))) | 232 | '(("r" . "ຼ"))) |
| 231 | 233 | ||
| 232 | (defconst lao-transcription-vowel-alist | 234 | (defconst lao-transcription-vowel-alist |
| 233 | (sort '(("a" . "ະ") | 235 | (sort |
| 236 | (copy-sequence | ||
| 237 | '(("a" . "ະ") | ||
| 234 | ("ar" . "າ") | 238 | ("ar" . "າ") |
| 235 | ("i" . "ິ") | 239 | ("i" . "ິ") |
| 236 | ("ii" . "ີ") | 240 | ("ii" . "ີ") |
| @@ -257,8 +261,8 @@ | |||
| 257 | ("ai" . "ໄ") | 261 | ("ai" . "ໄ") |
| 258 | ("ei" . "ໃ") | 262 | ("ei" . "ໃ") |
| 259 | ("ao" . ["ເົາ"]) | 263 | ("ao" . ["ເົາ"]) |
| 260 | ("aM" . "ຳ")) | 264 | ("aM" . "ຳ"))) |
| 261 | (function (lambda (x y) (> (length (car x)) (length (car y))))))) | 265 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 262 | 266 | ||
| 263 | ;; Maa-sakod is put at the tail. | 267 | ;; Maa-sakod is put at the tail. |
| 264 | (defconst lao-transcription-maa-sakod-alist | 268 | (defconst lao-transcription-maa-sakod-alist |
diff --git a/lisp/language/tibetan.el b/lisp/language/tibetan.el index d31cd5cd528..bbd4729f6c5 100644 --- a/lisp/language/tibetan.el +++ b/lisp/language/tibetan.el | |||
| @@ -326,7 +326,9 @@ | |||
| 326 | 326 | ||
| 327 | 327 | ||
| 328 | (defconst tibetan-subjoined-transcription-alist | 328 | (defconst tibetan-subjoined-transcription-alist |
| 329 | (sort '(("+k" . "ྐ") | 329 | (sort |
| 330 | (copy-sequence | ||
| 331 | '(("+k" . "ྐ") | ||
| 330 | ("+kh" . "ྑ") | 332 | ("+kh" . "ྑ") |
| 331 | ("+g" . "ྒ") | 333 | ("+g" . "ྒ") |
| 332 | ("+gh" . "ྒྷ") | 334 | ("+gh" . "ྒྷ") |
| @@ -371,8 +373,8 @@ | |||
| 371 | ("+W" . "ྺ") ;; fixed form subscribed WA | 373 | ("+W" . "ྺ") ;; fixed form subscribed WA |
| 372 | ("+Y" . "ྻ") ;; fixed form subscribed YA | 374 | ("+Y" . "ྻ") ;; fixed form subscribed YA |
| 373 | ("+R" . "ྼ") ;; fixed form subscribed RA | 375 | ("+R" . "ྼ") ;; fixed form subscribed RA |
| 374 | ) | 376 | )) |
| 375 | (lambda (x y) (> (length (car x)) (length (car y)))))) | 377 | (lambda (x y) (> (length (car x)) (length (car y)))))) |
| 376 | 378 | ||
| 377 | ;;; | 379 | ;;; |
| 378 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. | 380 | ;;; alist for Tibetan base consonant <-> subjoined consonant conversion. |