1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Use 'char-to-name'

* lisp/international/emoji.el (emoji--name): Lookup name using 'char-to-name'.
* lisp/international/textsec.el (textsec-domain-suspicious-p): And here.
* lisp/simple.el (what-cursor-position): And here.
This commit is contained in:
Robert Pluim 2024-06-07 12:07:50 +02:00
parent 3a4cf1aa1e
commit e4b243b931
3 changed files with 3 additions and 4 deletions

View file

@ -245,7 +245,7 @@ the name is not known."
(defun emoji--name (glyph) (defun emoji--name (glyph)
(or (gethash glyph emoji--names) (or (gethash glyph emoji--names)
(get-char-code-property (aref glyph 0) 'name))) (char-to-name (aref glyph 0))))
(defvar-keymap emoji-list-mode-map (defvar-keymap emoji-list-mode-map
"RET" #'emoji-list-select "RET" #'emoji-list-select

View file

@ -296,7 +296,7 @@ or use certain other unusual mixtures of characters."
"" ""
(concat ": " (string char))) (concat ": " (string char)))
char char
(get-char-code-property char 'name))))) (char-to-name char)))))
domain) domain)
;; Does IDNA allow it? ;; Does IDNA allow it?
(unless (puny-highly-restrictive-domain-p domain) (unless (puny-highly-restrictive-domain-p domain)

View file

@ -1827,8 +1827,7 @@ in *Help* buffer. See also the command `describe-char'."
(interactive "P") (interactive "P")
(let* ((char (following-char)) (let* ((char (following-char))
(char-name (and what-cursor-show-names (char-name (and what-cursor-show-names
(or (get-char-code-property char 'name) (char-to-name char)))
(get-char-code-property char 'old-name))))
(char-name-fmt (if char-name (char-name-fmt (if char-name
(format ", %s" char-name) (format ", %s" char-name)
"")) ""))