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/language | |
| 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/language')
| -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 |
3 files changed, 20 insertions, 14 deletions
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. |