diff options
| author | Stefan Kangas | 2021-12-05 19:09:48 +0100 |
|---|---|---|
| committer | Stefan Kangas | 2021-12-05 19:09:48 +0100 |
| commit | fad4049a099486d115fc4d5ef2b7952867b7ca44 (patch) | |
| tree | 55f140e996d466cfb69b8438d5b9ea40daf2cf64 /lisp/nxml | |
| parent | 19307704bd6e73a6740f60459a6b5b58203b6a2f (diff) | |
| download | emacs-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.
Diffstat (limited to 'lisp/nxml')
| -rw-r--r-- | lisp/nxml/rng-cmpct.el | 2 | ||||
| -rw-r--r-- | lisp/nxml/xmltok.el | 10 | ||||
| -rw-r--r-- | lisp/nxml/xsd-regexp.el | 6 |
3 files changed, 6 insertions, 12 deletions
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. | ||
| 976 | Return 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 |