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.
This commit is contained in:
Stefan Kangas 2021-12-05 19:09:48 +01:00
parent 19307704bd
commit fad4049a09
7 changed files with 16 additions and 22 deletions

View file

@ -31,7 +31,7 @@
(defun mm-ucs-to-char (codepoint)
"Convert Unicode codepoint to character."
(or (decode-char 'ucs codepoint) ?#))
(or codepoint ?#))
(defvar mm-coding-system-list nil)
(defun mm-get-coding-system-list ()

View file

@ -6573,8 +6573,8 @@ The value is a hanja character that is selected interactively."
(hanja-filter (lambda (x) (car x))
(mapcar (lambda (c)
(if (listp c)
(cons (decode-char 'ucs (car c)) (cdr c))
(list (decode-char 'ucs c))))
(cons (car c) (cdr c))
(list c)))
(aref hanja-table char)))))
(unwind-protect
(when (aref hanja-conversions 2)

View file

@ -429,7 +429,7 @@ When a Korean input method is off, convert the following hangul character."
(hangul3-input-method-jong char))
(t
(setq hangul-queue (make-vector 6 0))
(insert (decode-char 'ucs char))
(insert char)
(move-overlay quail-overlay (point) (point))))))
(defun hangul3-input-method (key)
@ -476,7 +476,7 @@ When a Korean input method is off, convert the following hangul character."
(hangul3-input-method-jong char))
(t
(setq hangul-queue (make-vector 6 0))
(insert (decode-char 'ucs char))
(insert char)
(move-overlay quail-overlay (point) (point))))))
(defun hangul390-input-method (key)

View file

@ -369,7 +369,7 @@ OVERRIDE is either nil, require or t."
(while (re-search-forward "\\\\x+{\\([[:xdigit:]]+\\)}"
(point-max)
t)
(let* ((ch (decode-char 'ucs (string-to-number (match-string 1) 16))))
(let* ((ch (string-to-number (match-string 1) 16)))
(if (and ch (> ch 0))
(let ((begin (match-beginning 0))
(end (match-end 0)))

View file

@ -943,7 +943,6 @@ and VALUE-END, otherwise a STRING giving the value."
(let ((n (string-to-number (buffer-substring-no-properties start end)
base)))
(cond ((and (integerp n) (xmltok-valid-char-p n))
(setq n (xmltok-unicode-to-char n))
(and n (string n)))
(t
(xmltok-add-error "Invalid character code" start end)
@ -971,11 +970,6 @@ and VALUE-END, otherwise a STRING giving the value."
(t (and (> n #xFFFF)
(< n #x110000)))))
(defun xmltok-unicode-to-char (n)
"Return the character corresponding to Unicode scalar value N.
Return nil if unsupported in Emacs."
(decode-char 'ucs n))
;;; Prolog parsing
(defvar xmltok-contains-doctype nil)
@ -1766,6 +1760,10 @@ and `xmltok-namespace-attributes'."
xmltok-type))
(message "Scanned end of file")))
;;; Obsolete
(define-obsolete-function-alias 'xmltok-unicode-to-char #'identity "29.1")
(provide 'xmltok)
;;; xmltok.el ends here

View file

@ -287,7 +287,7 @@ and whose tail is ACCUM."
(defun xsdre-compile-single-char (ch)
(if (memq ch '(?. ?* ?+ ?? ?\[ ?\] ?^ ?$ ?\\))
(string ?\\ ch)
(string (decode-char 'ucs ch))))
(string ch)))
(defun xsdre-char-class-to-range-list (cc)
"Return a range-list for a symbolic char-class CC."
@ -404,10 +404,6 @@ consisting of a single char alternative delimited with []."
(cons last chars)
(cons last (cons ?- chars))))))
(setq range-list (cdr range-list)))
(setq chars
(mapcar (lambda (c)
(decode-char 'ucs c))
chars))
(when caret
(setq chars (cons ?^ chars)))
(when hyphen

View file

@ -612,8 +612,8 @@ references."
(if (setq ref (match-string 2))
(progn ; Numeric char reference
(setq val (save-match-data
(decode-char 'ucs (string-to-number
ref (if (match-string 1) 16)))))
(string-to-number
ref (if (match-string 1) 16))))
(and (null val)
xml-validating-parser
(error "XML: (Validity) Invalid character reference `%s'"
@ -898,11 +898,11 @@ references and parameter-entity references."
ref val)
(cond ((setq ref (match-string 1 string))
;; Decimal character reference
(setq val (decode-char 'ucs (string-to-number ref)))
(setq val (string-to-number ref))
(if val (push (string val) children)))
;; Hexadecimal character reference
((setq ref (match-string 2 string))
(setq val (decode-char 'ucs (string-to-number ref 16)))
(setq val (string-to-number ref 16))
(if val (push (string val) children)))
;; Parameter entity reference
((setq ref (match-string 3 string))
@ -962,7 +962,7 @@ STRING is assumed to occur in an XML attribute value."
(if ref
;; [4.6] Character references are included as
;; character data.
(let ((val (decode-char 'ucs (string-to-number ref (if is-hex 16)))))
(let ((val (string-to-number ref (if is-hex 16))))
(push (cond (val (string val))
(xml-validating-parser
(error "XML: (Validity) Undefined character `x%s'" ref))