aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Kangas2021-12-05 19:09:48 +0100
committerStefan Kangas2021-12-05 19:09:48 +0100
commitfad4049a099486d115fc4d5ef2b7952867b7ca44 (patch)
tree55f140e996d466cfb69b8438d5b9ea40daf2cf64
parent19307704bd6e73a6740f60459a6b5b58203b6a2f (diff)
downloademacs-fad4049a099486d115fc4d5ef2b7952867b7ca44.tar.gz
emacs-fad4049a099486d115fc4d5ef2b7952867b7ca44.zip
Remove no-op calls to decode-char with 'ucs' arg
* lisp/gnus/mm-util.el (mm-ucs-to-char): * lisp/language/hanja-util.el (hangul-to-hanja-char): * lisp/leim/quail/hangul.el (hangul3-input-method-internal) (hangul390-input-method-internal): * lisp/nxml/rng-cmpct.el (rng-c-process-escapes): * lisp/nxml/xsd-regexp.el (xsdre-compile-single-char) (xsdre-range-list-to-char-alternative): * lisp/xml.el (xml-parse-string, xml--entity-replacement-text) (xml-substitute-special): Remove calls to decode-char where first argument is 'ucs'; that is now a no-op. Discussed in Bug#52263. * lisp/nxml/xmltok.el (xmltok-unicode-to-char): Make into obsolete function alias for 'identity'. Update single caller.
-rw-r--r--lisp/gnus/mm-util.el2
-rw-r--r--lisp/language/hanja-util.el4
-rw-r--r--lisp/leim/quail/hangul.el4
-rw-r--r--lisp/nxml/rng-cmpct.el2
-rw-r--r--lisp/nxml/xmltok.el10
-rw-r--r--lisp/nxml/xsd-regexp.el6
-rw-r--r--lisp/xml.el10
7 files changed, 16 insertions, 22 deletions
diff --git a/lisp/gnus/mm-util.el b/lisp/gnus/mm-util.el
index 92e04f9d2ee..ddc228e4900 100644
--- a/lisp/gnus/mm-util.el
+++ b/lisp/gnus/mm-util.el
@@ -31,7 +31,7 @@
31 31
32(defun mm-ucs-to-char (codepoint) 32(defun mm-ucs-to-char (codepoint)
33 "Convert Unicode codepoint to character." 33 "Convert Unicode codepoint to character."
34 (or (decode-char 'ucs codepoint) ?#)) 34 (or codepoint ?#))
35 35
36(defvar mm-coding-system-list nil) 36(defvar mm-coding-system-list nil)
37(defun mm-get-coding-system-list () 37(defun mm-get-coding-system-list ()
diff --git a/lisp/language/hanja-util.el b/lisp/language/hanja-util.el
index 9e9213536cb..fe6323d42ba 100644
--- a/lisp/language/hanja-util.el
+++ b/lisp/language/hanja-util.el
@@ -6573,8 +6573,8 @@ The value is a hanja character that is selected interactively."
6573 (hanja-filter (lambda (x) (car x)) 6573 (hanja-filter (lambda (x) (car x))
6574 (mapcar (lambda (c) 6574 (mapcar (lambda (c)
6575 (if (listp c) 6575 (if (listp c)
6576 (cons (decode-char 'ucs (car c)) (cdr c)) 6576 (cons (car c) (cdr c))
6577 (list (decode-char 'ucs c)))) 6577 (list c)))
6578 (aref hanja-table char))))) 6578 (aref hanja-table char)))))
6579 (unwind-protect 6579 (unwind-protect
6580 (when (aref hanja-conversions 2) 6580 (when (aref hanja-conversions 2)
diff --git a/lisp/leim/quail/hangul.el b/lisp/leim/quail/hangul.el
index c03e86b33c0..d069b5b68e1 100644
--- a/lisp/leim/quail/hangul.el
+++ b/lisp/leim/quail/hangul.el
@@ -429,7 +429,7 @@ When a Korean input method is off, convert the following hangul character."
429 (hangul3-input-method-jong char)) 429 (hangul3-input-method-jong char))
430 (t 430 (t
431 (setq hangul-queue (make-vector 6 0)) 431 (setq hangul-queue (make-vector 6 0))
432 (insert (decode-char 'ucs char)) 432 (insert char)
433 (move-overlay quail-overlay (point) (point)))))) 433 (move-overlay quail-overlay (point) (point))))))
434 434
435(defun hangul3-input-method (key) 435(defun hangul3-input-method (key)
@@ -476,7 +476,7 @@ When a Korean input method is off, convert the following hangul character."
476 (hangul3-input-method-jong char)) 476 (hangul3-input-method-jong char))
477 (t 477 (t
478 (setq hangul-queue (make-vector 6 0)) 478 (setq hangul-queue (make-vector 6 0))
479 (insert (decode-char 'ucs char)) 479 (insert char)
480 (move-overlay quail-overlay (point) (point)))))) 480 (move-overlay quail-overlay (point) (point))))))
481 481
482(defun hangul390-input-method (key) 482(defun hangul390-input-method (key)
diff --git a/lisp/nxml/rng-cmpct.el b/lisp/nxml/rng-cmpct.el
index dd3000773fd..1476aa0e5a3 100644
--- a/lisp/nxml/rng-cmpct.el
+++ b/lisp/nxml/rng-cmpct.el
@@ -369,7 +369,7 @@ OVERRIDE is either nil, require or t."
369 (while (re-search-forward "\\\\x+{\\([[:xdigit:]]+\\)}" 369 (while (re-search-forward "\\\\x+{\\([[:xdigit:]]+\\)}"
370 (point-max) 370 (point-max)
371 t) 371 t)
372 (let* ((ch (decode-char 'ucs (string-to-number (match-string 1) 16)))) 372 (let* ((ch (string-to-number (match-string 1) 16)))
373 (if (and ch (> ch 0)) 373 (if (and ch (> ch 0))
374 (let ((begin (match-beginning 0)) 374 (let ((begin (match-beginning 0))
375 (end (match-end 0))) 375 (end (match-end 0)))
diff --git a/lisp/nxml/xmltok.el b/lisp/nxml/xmltok.el
index 6159e00c511..ecad501a644 100644
--- a/lisp/nxml/xmltok.el
+++ b/lisp/nxml/xmltok.el
@@ -943,7 +943,6 @@ and VALUE-END, otherwise a STRING giving the value."
943 (let ((n (string-to-number (buffer-substring-no-properties start end) 943 (let ((n (string-to-number (buffer-substring-no-properties start end)
944 base))) 944 base)))
945 (cond ((and (integerp n) (xmltok-valid-char-p n)) 945 (cond ((and (integerp n) (xmltok-valid-char-p n))
946 (setq n (xmltok-unicode-to-char n))
947 (and n (string n))) 946 (and n (string n)))
948 (t 947 (t
949 (xmltok-add-error "Invalid character code" start end) 948 (xmltok-add-error "Invalid character code" start end)
@@ -971,11 +970,6 @@ and VALUE-END, otherwise a STRING giving the value."
971 (t (and (> n #xFFFF) 970 (t (and (> n #xFFFF)
972 (< n #x110000))))) 971 (< n #x110000)))))
973 972
974(defun xmltok-unicode-to-char (n)
975 "Return the character corresponding to Unicode scalar value N.
976Return nil if unsupported in Emacs."
977 (decode-char 'ucs n))
978
979;;; Prolog parsing 973;;; Prolog parsing
980 974
981(defvar xmltok-contains-doctype nil) 975(defvar xmltok-contains-doctype nil)
@@ -1766,6 +1760,10 @@ and `xmltok-namespace-attributes'."
1766 xmltok-type)) 1760 xmltok-type))
1767 (message "Scanned end of file"))) 1761 (message "Scanned end of file")))
1768 1762
1763;;; Obsolete
1764
1765(define-obsolete-function-alias 'xmltok-unicode-to-char #'identity "29.1")
1766
1769(provide 'xmltok) 1767(provide 'xmltok)
1770 1768
1771;;; xmltok.el ends here 1769;;; xmltok.el ends here
diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el
index 3c29803ab97..d6eaf7cc4bc 100644
--- a/lisp/nxml/xsd-regexp.el
+++ b/lisp/nxml/xsd-regexp.el
@@ -287,7 +287,7 @@ and whose tail is ACCUM."
287(defun xsdre-compile-single-char (ch) 287(defun xsdre-compile-single-char (ch)
288 (if (memq ch '(?. ?* ?+ ?? ?\[ ?\] ?^ ?$ ?\\)) 288 (if (memq ch '(?. ?* ?+ ?? ?\[ ?\] ?^ ?$ ?\\))
289 (string ?\\ ch) 289 (string ?\\ ch)
290 (string (decode-char 'ucs ch)))) 290 (string ch)))
291 291
292(defun xsdre-char-class-to-range-list (cc) 292(defun xsdre-char-class-to-range-list (cc)
293 "Return a range-list for a symbolic char-class CC." 293 "Return a range-list for a symbolic char-class CC."
@@ -404,10 +404,6 @@ consisting of a single char alternative delimited with []."
404 (cons last chars) 404 (cons last chars)
405 (cons last (cons ?- chars)))))) 405 (cons last (cons ?- chars))))))
406 (setq range-list (cdr range-list))) 406 (setq range-list (cdr range-list)))
407 (setq chars
408 (mapcar (lambda (c)
409 (decode-char 'ucs c))
410 chars))
411 (when caret 407 (when caret
412 (setq chars (cons ?^ chars))) 408 (setq chars (cons ?^ chars)))
413 (when hyphen 409 (when hyphen
diff --git a/lisp/xml.el b/lisp/xml.el
index 0282e3741c0..e2ba02e1952 100644
--- a/lisp/xml.el
+++ b/lisp/xml.el
@@ -612,8 +612,8 @@ references."
612 (if (setq ref (match-string 2)) 612 (if (setq ref (match-string 2))
613 (progn ; Numeric char reference 613 (progn ; Numeric char reference
614 (setq val (save-match-data 614 (setq val (save-match-data
615 (decode-char 'ucs (string-to-number 615 (string-to-number
616 ref (if (match-string 1) 16))))) 616 ref (if (match-string 1) 16))))
617 (and (null val) 617 (and (null val)
618 xml-validating-parser 618 xml-validating-parser
619 (error "XML: (Validity) Invalid character reference `%s'" 619 (error "XML: (Validity) Invalid character reference `%s'"
@@ -898,11 +898,11 @@ references and parameter-entity references."
898 ref val) 898 ref val)
899 (cond ((setq ref (match-string 1 string)) 899 (cond ((setq ref (match-string 1 string))
900 ;; Decimal character reference 900 ;; Decimal character reference
901 (setq val (decode-char 'ucs (string-to-number ref))) 901 (setq val (string-to-number ref))
902 (if val (push (string val) children))) 902 (if val (push (string val) children)))
903 ;; Hexadecimal character reference 903 ;; Hexadecimal character reference
904 ((setq ref (match-string 2 string)) 904 ((setq ref (match-string 2 string))
905 (setq val (decode-char 'ucs (string-to-number ref 16))) 905 (setq val (string-to-number ref 16))
906 (if val (push (string val) children))) 906 (if val (push (string val) children)))
907 ;; Parameter entity reference 907 ;; Parameter entity reference
908 ((setq ref (match-string 3 string)) 908 ((setq ref (match-string 3 string))
@@ -962,7 +962,7 @@ STRING is assumed to occur in an XML attribute value."
962 (if ref 962 (if ref
963 ;; [4.6] Character references are included as 963 ;; [4.6] Character references are included as
964 ;; character data. 964 ;; character data.
965 (let ((val (decode-char 'ucs (string-to-number ref (if is-hex 16))))) 965 (let ((val (string-to-number ref (if is-hex 16))))
966 (push (cond (val (string val)) 966 (push (cond (val (string val))
967 (xml-validating-parser 967 (xml-validating-parser
968 (error "XML: (Validity) Undefined character `x%s'" ref)) 968 (error "XML: (Validity) Undefined character `x%s'" ref))