diff options
| -rw-r--r-- | lisp/play/emoji.el | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/play/emoji.el b/lisp/play/emoji.el index 46980e19c58..ef63c5c8c63 100644 --- a/lisp/play/emoji.el +++ b/lisp/play/emoji.el | |||
| @@ -269,7 +269,7 @@ character) under point is." | |||
| 269 | ;; Remove glyphs we don't have in graphical displays. | 269 | ;; Remove glyphs we don't have in graphical displays. |
| 270 | (if (let ((char (elt glyph 0))) | 270 | (if (let ((char (elt glyph 0))) |
| 271 | (if emoji--font | 271 | (if emoji--font |
| 272 | (font-get-glyphs emoji--font 0 1 (vector char)) | 272 | (font-has-char-p emoji--font char) |
| 273 | (when-let ((font (car (internal-char-font nil char)))) | 273 | (when-let ((font (car (internal-char-font nil char)))) |
| 274 | (setq emoji--font font)))) | 274 | (setq emoji--font font)))) |
| 275 | (setq alist (cdr alist)) | 275 | (setq alist (cdr alist)) |
| @@ -550,17 +550,19 @@ We prefer the earliest unique letter." | |||
| 550 | 550 | ||
| 551 | (defun emoji--compute-name (entry) | 551 | (defun emoji--compute-name (entry) |
| 552 | "Add example emojis to the name." | 552 | "Add example emojis to the name." |
| 553 | (let ((name (concat (car entry) " ")) | 553 | (let* ((name (concat (car entry) " ")) |
| 554 | (children (emoji--flatten entry)) | 554 | (children (emoji--flatten entry)) |
| 555 | (max 30)) | 555 | (length (length name)) |
| 556 | (max 30)) | ||
| 556 | (cl-loop for i from 0 upto 20 | 557 | (cl-loop for i from 0 upto 20 |
| 557 | ;; Choose from all the children. | 558 | ;; Choose from all the children. |
| 558 | while (< (string-width name) max) | 559 | while (< length max) |
| 559 | do (cl-loop for child in children | 560 | do (cl-loop for child in children |
| 560 | for glyph = (elt child i) | 561 | for glyph = (elt child i) |
| 561 | while (< (string-width name) max) | 562 | while (< length max) |
| 562 | when glyph | 563 | when glyph |
| 563 | do (setq name (concat name glyph)))) | 564 | do (setq name (concat name glyph) |
| 565 | length (+ length 2)))) | ||
| 564 | (if (= (length name) max) | 566 | (if (= (length name) max) |
| 565 | ;; Make an ellipsis signal that we've not exhausted the | 567 | ;; Make an ellipsis signal that we've not exhausted the |
| 566 | ;; possibilities. | 568 | ;; possibilities. |