Avoid signaling errors in emoji.el on empty input

* lisp/international/emoji.el (emoji--read-emoji):  Signal
user-error on empty input.  (Bug#68671)

Do not merge to master.
This commit is contained in:
Eshel Yaron 2024-01-27 14:01:47 +01:00 committed by Eli Zaretskii
parent 53481cc954
commit 3c2baa1b95

View file

@ -680,11 +680,12 @@ We prefer the earliest unique letter."
strings))))
(complete-with-action action table string pred)))
nil t)))
(when (cl-plusp (length name))
(let ((glyph (if emoji-alternate-names
(cadr (split-string name "\t"))
(gethash name emoji--all-bases))))
(cons glyph (gethash glyph emoji--derived))))))
(if (cl-plusp (length name))
(let ((glyph (if emoji-alternate-names
(cadr (split-string name "\t"))
(gethash name emoji--all-bases))))
(cons glyph (gethash glyph emoji--derived)))
(user-error "You didn't specify an emoji"))))
(defun emoji--choose-emoji ()
(pcase-let ((`(,glyph . ,derived) (emoji--read-emoji)))