]> git.eshelyaron.com Git - emacs.git/commitdiff
; (emoji--read-emoji): Signal error on empty input (Bug#68671)
authorEshel Yaron <me@eshelyaron.com>
Sat, 27 Jan 2024 13:01:47 +0000 (14:01 +0100)
committerEshel Yaron <me@eshelyaron.com>
Sat, 27 Jan 2024 13:01:47 +0000 (14:01 +0100)
lisp/international/emoji.el

index 3b97d6915af7b872c339cd48a8c34323a4160cd0..cab1d2e663ca98746302243ded83c9d9395e5b42 100644 (file)
@@ -680,11 +680,12 @@ We prefer the earliest unique letter."
                                       "")))
                             strings)))))
            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"))))
 
 (defvar-keymap emoji-zoom-map
   "+" #'emoji-zoom-increase