Don't call purecopy in international/*.el

* lisp/international/fontset.el (font-encoding-alist,)
(x-pixel-size-width-font-regexp, vertical-centering-font-regexp)
(face-font-rescale-alist, standard-fontset-spec):
* lisp/international/latexenc.el (latex-inputenc-coding-alist):
* lisp/international/mule-cmds.el (help-xref-mule-regexp-template)
(set-language-info-internal, set-language-info-alist)
(register-input-method, locale-language-names)
(locale-charset-language-names, locale-preferred-coding-systems)
(define-char-code-property):
* lisp/international/mule-conf.el (file-coding-system-alist):
* lisp/international/mule-diag.el (sort-listed-character-sets):
* lisp/international/mule.el (define-charset, load-with-code-conversion)
(put-charset-property, define-coding-system)
(ctext-non-standard-encodings-alist)
(ctext-non-standard-encodings-regexp, auto-coding-alist)
(auto-coding-regexp-alist):
* lisp/international/quail.el (quail-keyboard-layout-button):
(quail-keyboard-customize-button): Remove calls to purecopy.
This commit is contained in:
Stefan Kangas 2024-08-23 20:21:41 +02:00
parent 538a242898
commit 833037fadd
7 changed files with 76 additions and 106 deletions

View file

@ -33,8 +33,6 @@
;; Setup font-encoding-alist for all known encodings.
(setq font-encoding-alist
(mapcar (lambda (arg)
(cons (purecopy (car arg)) (cdr arg)))
'(("iso8859-1$" . iso-8859-1)
("iso8859-2$" . iso-8859-2)
("iso8859-3$" . iso-8859-3)
@ -122,7 +120,7 @@
("mulelao-1" . mule-lao)
("muletibetan-2" . tibetan)
("muletibetan-0" . tibetan)
("muletibetan-1" . tibetan-1-column))))
("muletibetan-1" . tibetan-1-column)))
(defvar font-encoding-charset-alist)
@ -1244,17 +1242,17 @@ Internal use only. Should be called at startup time."
;; Setting for suppressing XLoadQueryFont on big fonts.
(setq x-pixel-size-width-font-regexp
(purecopy "gb2312\\|gbk\\|gb18030\\|jisx0208\\|ksc5601\\|cns11643\\|big5"))
"gb2312\\|gbk\\|gb18030\\|jisx0208\\|ksc5601\\|cns11643\\|big5")
;; These fonts require vertical centering.
(setq vertical-centering-font-regexp
(purecopy "gb2312\\|gbk\\|gb18030\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5"))
"gb2312\\|gbk\\|gb18030\\|jisx0208\\|jisx0212\\|ksc5601\\|cns11643\\|big5")
(put 'vertical-centering-font-regexp 'standard-value
(list vertical-centering-font-regexp))
;; CDAC fonts are actually smaller than their design sizes.
(setq face-font-rescale-alist
(list (cons (purecopy "-cdac$") 1.3)))
(list '("-cdac$" . 1.3)))
(defvar x-font-name-charset-alist nil
"This variable has no meaning starting with Emacs 22.1.")
@ -1574,7 +1572,7 @@ It returns a name of the created fontset."
;; specified here because FAMILY of those fonts are not "fixed" in
;; many cases.
(defvar standard-fontset-spec
(purecopy "-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard")
"-*-fixed-medium-r-normal-*-16-*-*-*-*-*-fontset-standard"
"String of fontset spec of the standard fontset.
You have the biggest chance to display international characters
with correct glyphs by using the standard fontset.

View file

@ -51,7 +51,6 @@
;;;###autoload
(defcustom latex-inputenc-coding-alist
(purecopy
'(("ansinew" . windows-1252) ; MS Windows ANSI encoding, extension of Latin-1
("applemac" . mac-roman)
("ascii" . us-ascii)
@ -74,7 +73,7 @@
;; ("macce" . undecided) ; Apple Central European
("next" . next) ; The Next encoding
("utf8" . utf-8)
("utf8x" . utf-8))) ; used by the Unicode LaTeX package
("utf8x" . utf-8)) ; used by the Unicode LaTeX package
"Mapping from LaTeX encodings in \"inputenc.sty\" to Emacs coding systems.
LaTeX encodings are specified with \"\\usepackage[encoding]{inputenc}\".
Used by the function `latexenc-find-file-coding-system'."

View file

@ -169,14 +169,14 @@
;;; Mule related hyperlinks.
(defconst help-xref-mule-regexp-template
(purecopy (concat "\\(\\<\\("
"\\(coding system\\)\\|"
"\\(input method\\)\\|"
"\\(character set\\)\\|"
"\\(charset\\)"
"\\)\\s-+\\)?"
;; Note starting with word-syntax character:
"['`]\\(\\sw\\(\\sw\\|\\s_\\)+\\)[']")))
(concat "\\(\\<\\("
"\\(coding system\\)\\|"
"\\(input method\\)\\|"
"\\(character set\\)\\|"
"\\(charset\\)"
"\\)\\s-+\\)?"
;; Note starting with word-syntax character:
"['`]\\(\\sw\\(\\sw\\|\\s_\\)+\\)[']"))
(defun coding-system-change-eol-conversion (coding-system eol-type)
"Return a coding system which differs from CODING-SYSTEM in EOL conversion.
@ -1201,7 +1201,7 @@ Arguments are the same as `set-language-info'."
(progn
(setq key-slot (list key))
(setcdr lang-slot (cons key-slot (cdr lang-slot)))))
(setcdr key-slot (purecopy info))
(setcdr key-slot info)
;; Update the custom-type of `current-language-environment'.
(put 'current-language-environment 'custom-type
(cons 'choice (mapcar
@ -1229,10 +1229,8 @@ where to put this language environment in the
Describe Language Environment and Set Language Environment menus.
For example, (\"European\") means to put this language environment
in the European submenu in each of those two menus."
(cond ((symbolp lang-env)
(setq lang-env (symbol-name lang-env)))
((stringp lang-env)
(setq lang-env (purecopy lang-env))))
(when (symbolp lang-env)
(setq lang-env (symbol-name lang-env)))
(if parents
(while parents
(let (describe-map setup-map parent-symbol parent prompt)
@ -1439,13 +1437,11 @@ The commands `describe-input-method' and `list-input-methods' need
these duplicated values to show some information about input methods
without loading the relevant Quail packages.
\n(fn INPUT-METHOD LANG-ENV ACTIVATE-FUNC TITLE DESCRIPTION &rest ARGS)"
(setq lang-env (if (symbolp lang-env)
(symbol-name lang-env)
(purecopy lang-env)))
(setq input-method (if (symbolp input-method)
(symbol-name input-method)
(purecopy input-method)))
(setq args (mapcar #'purecopy args))
(when (symbolp lang-env)
(setq lang-env (symbol-name lang-env)))
(when (symbolp input-method)
(setq input-method (symbol-name input-method)))
(let ((info (cons lang-env args))
(slot (assoc input-method input-method-alist)))
(if slot
@ -2252,12 +2248,8 @@ See `set-language-info-alist' for use in programs."
(defvar locale-translation-file-name nil
"File name for the system's file of locale-name aliases, or nil if none.")
;; The following definitions might as well be marked as constants and
;; purecopied, since they're normally used on startup, and probably
;; should reflect the facilities of the base Emacs.
(defconst locale-language-names
(purecopy
'(
'(
;; Locale names of the form LANGUAGE[_TERRITORY][.CODESET][@MODIFIER]
;; as specified in the Single Unix Spec, Version 2.
;; LANGUAGE is a language code taken from ISO 639:1988 (E/F)
@ -2515,7 +2507,7 @@ See `set-language-info-alist' for use in programs."
; mwk MS-Windows Mohawk (Canada)
("uig" . "UTF-8") ; MS-Windows Uighur
("kin" . "UTF-8") ; MS-Windows Kinyarwanda
))
)
"Alist of locale regexps vs the corresponding languages and coding systems.
Each element has this form:
(LOCALE-REGEXP LANG-ENV CODING-SYSTEM)
@ -2528,18 +2520,17 @@ In this case, LANG-ENV is one of generic language environments for an
specific encoding such as \"Latin-1\" and \"UTF-8\".")
(defconst locale-charset-language-names
(purecopy
'((".*8859[-_]?1\\>" . "Latin-1")
(".*8859[-_]?2\\>" . "Latin-2")
(".*8859[-_]?3\\>" . "Latin-3")
(".*8859[-_]?4\\>" . "Latin-4")
(".*8859[-_]?9\\>" . "Latin-5")
(".*8859[-_]?14\\>" . "Latin-8")
(".*8859[-_]?15\\>" . "Latin-9")
(".*utf\\(?:-?8\\)?\\>" . "UTF-8")
;; utf-8@euro exists, so put this last. (@euro really specifies
;; the currency, rather than the charset.)
(".*@euro\\>" . "Latin-9")))
'((".*8859[-_]?1\\>" . "Latin-1")
(".*8859[-_]?2\\>" . "Latin-2")
(".*8859[-_]?3\\>" . "Latin-3")
(".*8859[-_]?4\\>" . "Latin-4")
(".*8859[-_]?9\\>" . "Latin-5")
(".*8859[-_]?14\\>" . "Latin-8")
(".*8859[-_]?15\\>" . "Latin-9")
(".*utf\\(?:-?8\\)?\\>" . "UTF-8")
;; utf-8@euro exists, so put this last. (@euro really specifies
;; the currency, rather than the charset.)
(".*@euro\\>" . "Latin-9"))
"List of pairs of locale regexps and charset language names.
The first element whose locale regexp matches the start of a downcased locale
specifies the language name whose charset corresponds to that locale.
@ -2547,34 +2538,33 @@ This language name is used if the locale is not listed in
`locale-language-names'.")
(defconst locale-preferred-coding-systems
(purecopy
'((".*8859[-_]?1\\>" . iso-8859-1)
(".*8859[-_]?2\\>" . iso-8859-2)
(".*8859[-_]?3\\>" . iso-8859-3)
(".*8859[-_]?4\\>" . iso-8859-4)
(".*8859[-_]?9\\>" . iso-8859-9)
(".*8859[-_]?14\\>" . iso-8859-14)
(".*8859[-_]?15\\>" . iso-8859-15)
(".*utf\\(?:-?8\\)?" . utf-8)
;; utf-8@euro exists, so put this after utf-8. (@euro really
;; specifies the currency, rather than the charset.)
(".*@euro" . iso-8859-15)
("koi8-?r" . koi8-r)
("koi8-?u" . koi8-u)
("tcvn" . tcvn)
("big5[-_]?hkscs" . big5-hkscs)
("big5" . big5)
("euc-?tw" . euc-tw)
("euc-?cn" . euc-cn)
("gb2312" . gb2312)
("gbk" . gbk)
("gb18030" . gb18030)
("ja.*[._]euc" . japanese-iso-8bit)
("ja.*[._]jis7" . iso-2022-jp)
("ja.*[._]pck" . japanese-shift-jis)
("ja.*[._]sjis" . japanese-shift-jis)
("jpn" . japanese-shift-jis) ; MS-Windows uses this.
))
'((".*8859[-_]?1\\>" . iso-8859-1)
(".*8859[-_]?2\\>" . iso-8859-2)
(".*8859[-_]?3\\>" . iso-8859-3)
(".*8859[-_]?4\\>" . iso-8859-4)
(".*8859[-_]?9\\>" . iso-8859-9)
(".*8859[-_]?14\\>" . iso-8859-14)
(".*8859[-_]?15\\>" . iso-8859-15)
(".*utf\\(?:-?8\\)?" . utf-8)
;; utf-8@euro exists, so put this after utf-8. (@euro really
;; specifies the currency, rather than the charset.)
(".*@euro" . iso-8859-15)
("koi8-?r" . koi8-r)
("koi8-?u" . koi8-u)
("tcvn" . tcvn)
("big5[-_]?hkscs" . big5-hkscs)
("big5" . big5)
("euc-?tw" . euc-tw)
("euc-?cn" . euc-cn)
("gb2312" . gb2312)
("gbk" . gbk)
("gb18030" . gb18030)
("ja.*[._]euc" . japanese-iso-8bit)
("ja.*[._]jis7" . iso-2022-jp)
("ja.*[._]pck" . japanese-shift-jis)
("ja.*[._]sjis" . japanese-shift-jis)
("jpn" . japanese-shift-jis) ; MS-Windows uses this.
)
"List of pairs of locale regexps and preferred coding systems.
The first element whose locale regexp matches the start of a downcased locale
specifies the coding system to prefer when using that locale.
@ -2965,7 +2955,6 @@ See also the documentation of `get-char-code-property' and
(error "Invalid char-table: %s" table))
(or (stringp table)
(error "Not a char-table nor a file name: %s" table)))
(if (stringp table) (setq table (purecopy table)))
(if (and (stringp table)
(char-table-p (alist-get name char-code-property-alist)))
;; The table is already setup and we're apparently trying to
@ -2973,7 +2962,7 @@ See also the documentation of `get-char-code-property' and
;; Just skip it, in order to work around a recursive load (bug#52945).
nil
(setf (alist-get name char-code-property-alist) table)
(put name 'char-code-property-documentation (purecopy docstring))))
(put name 'char-code-property-documentation docstring)))
(defvar char-code-property-table
(make-char-table 'char-code-property-table)

View file

@ -1633,7 +1633,6 @@ for decoding and encoding files, process I/O, etc."
;; Tar files are not decoded at all, but we treat them as raw bytes.
(setq file-coding-system-alist
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\.elc\\'" . utf-8-emacs)
("\\.el\\'" . prefer-utf-8)
("\\.utf\\(-8\\)?\\'" . utf-8)
@ -1647,7 +1646,7 @@ for decoding and encoding files, process I/O, etc."
("\\.tar\\'" . (no-conversion . no-conversion))
( "\\.po[tx]?\\'\\|\\.po\\." . po-find-file-coding-system)
("\\.\\(tex\\|ltx\\|dtx\\|drv\\)\\'" . latexenc-find-file-coding-system)
("" . (undecided . nil)))))
("" . (undecided . nil))))
;;; Setting coding categories and their priorities.

View file

@ -43,7 +43,7 @@
;;; CHARSET
(define-button-type 'sort-listed-character-sets
'help-echo (purecopy "mouse-2, RET: sort on this column")
'help-echo "mouse-2, RET: sort on this column"
'face 'bold
'action (lambda (button)
(sort-listed-character-sets (button-get button 'sort-key))))

View file

@ -265,7 +265,7 @@ attribute."
(aset emacs-mule-charset-table emacs-mule-id name)))
(dolist (slot attrs)
(setcdr slot (purecopy (plist-get props (car slot)))))
(setcdr slot (plist-get props (car slot))))
;; Make sure that the value of :code-space is a vector of 8
;; elements.
@ -278,19 +278,12 @@ attribute."
;; Add :name and :docstring properties to PROPS.
(setq props
(cons :name (cons name (cons :docstring (cons (purecopy docstring) props)))))
(cons :name (cons name (cons :docstring (cons docstring props)))))
(or (plist-get props :short-name)
(plist-put props :short-name (symbol-name name)))
(or (plist-get props :long-name)
(plist-put props :long-name (plist-get props :short-name)))
(plist-put props :base name)
;; We can probably get a worthwhile amount in purespace.
(setq props
(mapcar (lambda (elt)
(if (stringp elt)
(purecopy elt)
elt))
props))
(setcdr (assq :plist attrs) props)
(apply 'define-charset-internal name (mapcar 'cdr attrs))))
@ -326,7 +319,7 @@ Return t if file exists."
(message "Loading %s (source)..." file)
(message "Loading %s..." file)))
(when purify-flag
(push (purecopy file) preloaded-file-list))
(push file preloaded-file-list))
(unwind-protect
(let ((load-true-file-name fullname)
(load-file-name fullname)
@ -440,10 +433,7 @@ This is the last value stored with
"Set CHARSETS's PROPNAME property to value VALUE.
It can be retrieved with `(get-charset-property CHARSET PROPNAME)'."
(set-charset-plist charset
(plist-put (charset-plist charset) propname
(if (stringp value)
(purecopy value)
value))))
(plist-put (charset-plist charset) propname value)))
(defun charset-description (charset)
"Return description string of CHARSET."
@ -984,8 +974,7 @@ non-ASCII files. This attribute is meaningful only when
;; Add :name and :docstring properties to PROPS.
(setq props
(cons :name (cons name (cons :docstring (cons (purecopy docstring)
props)))))
(cons :name (cons name (cons :docstring (cons docstring props)))))
(setcdr (assq :plist common-attrs) props)
(apply #'define-coding-system-internal
name (mapcar #'cdr (append common-attrs spec-attrs)))))
@ -1529,13 +1518,12 @@ This setting is effective for the next communication only."
;;; X selections
(defvar ctext-non-standard-encodings-alist
(mapcar 'purecopy
'(("big5-0" big5 2 big5)
("ISO8859-14" iso-8859-14 1 latin-iso8859-14)
("ISO8859-15" iso-8859-15 1 latin-iso8859-15)
("gbk-0" gbk 2 chinese-gbk)
("koi8-r" koi8-r 1 koi8-r)
("microsoft-cp1251" windows-1251 1 windows-1251)))
("microsoft-cp1251" windows-1251 1 windows-1251))
"Alist of non-standard encoding names vs the corresponding usages in CTEXT.
It controls how extended segments of a compound text are handled
@ -1568,14 +1556,13 @@ Each element must be one of the names listed in the variable
`ctext-non-standard-encodings-alist' (which see).")
(defvar ctext-non-standard-encodings-regexp
(purecopy
(string-to-multibyte
(concat
;; For non-standard encodings.
"\\(\e%/[0-4][\200-\377][\200-\377]\\([^\002]+\\)\002\\)"
"\\|"
;; For UTF-8 encoding.
"\\(\e%G[^\e]*\e%@\\)"))))
"\\(\e%G[^\e]*\e%@\\)")))
;; Functions to support "Non-Standard Character Set Encodings" defined
;; by the COMPOUND-TEXT spec. They also support "The UTF-8 encoding"
@ -1746,7 +1733,6 @@ in-place."
(defcustom auto-coding-alist
;; .exe and .EXE are added to support archive-mode looking at DOS
;; self-extracting exe archives.
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\.\\(\
arc\\|zip\\|lzh\\|lha\\|zoo\\|[jew]ar\\|xpi\\|rar\\|7z\\|squashfs\\|\
ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\|SQUASHFS\\)\\'"
@ -1756,7 +1742,7 @@ ARC\\|ZIP\\|LZH\\|LHA\\|ZOO\\|[JEW]AR\\|XPI\\|RAR\\|7Z\\|SQUASHFS\\)\\'"
("\\.\\(gz\\|Z\\|bz\\|bz2\\|xz\\|gpg\\)\\'" . no-conversion)
("\\.\\(jpe?g\\|png\\|gif\\|tiff?\\|p[bpgn]m\\)\\'" . no-conversion)
("\\.pdf\\'" . no-conversion)
("/#[^/]+#\\'" . utf-8-emacs-unix)))
("/#[^/]+#\\'" . utf-8-emacs-unix))
"Alist of filename patterns vs corresponding coding systems.
Each element looks like (REGEXP . CODING-SYSTEM).
A file whose name matches REGEXP is decoded by CODING-SYSTEM on reading.
@ -1771,12 +1757,11 @@ and the contents of `file-coding-system-alist'."
(symbol :tag "Coding system"))))
(defcustom auto-coding-regexp-alist
(mapcar (lambda (arg) (cons (purecopy (car arg)) (cdr arg)))
'(("\\`BABYL OPTIONS:[ \t]*-\\*-[ \t]*rmail[ \t]*-\\*-" . no-conversion)
("\\`\xFE\xFF" . utf-16be-with-signature)
("\\`\xFF\xFE" . utf-16le-with-signature)
("\\`\xEF\xBB\xBF" . utf-8-with-signature)
("\\`;ELC\024\0\0\0" . emacs-mule))) ; Emacs 20-compiled
("\\`;ELC\024\0\0\0" . emacs-mule)) ; Emacs 20-compiled
"Alist of patterns vs corresponding coding systems.
Each element looks like (REGEXP . CODING-SYSTEM).
A file whose first bytes match REGEXP is decoded by CODING-SYSTEM on reading.

View file

@ -2494,11 +2494,11 @@ should be made by `quail-build-decode-map' (which see)."
(help-setup-xref `(quail-keyboard-layout-button ,layout)
nil)
(quail-show-keyboard-layout layout))
'help-echo (purecopy "mouse-2, RET: show keyboard layout"))
'help-echo "mouse-2, RET: show keyboard layout")
(define-button-type 'quail-keyboard-customize-button
:supertype 'help-customize-variable
'help-echo (purecopy "mouse-2, RET: customize keyboard layout"))
'help-echo "mouse-2, RET: customize keyboard layout")
(defun quail-help (&optional package)
"Show brief description of the current Quail package.