emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

scratch/emoji d14bf62: Compute the width of the menu options better


From: Lars Ingebrigtsen
Subject: scratch/emoji d14bf62: Compute the width of the menu options better
Date: Thu, 28 Oct 2021 04:58:40 -0400 (EDT)

branch: scratch/emoji
commit d14bf62c3e0398462b4574d572f4a1183c9a0e9c
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Compute the width of the menu options better
---
 lisp/play/emoji.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/lisp/play/emoji.el b/lisp/play/emoji.el
index 391b2c2..593f8de 100644
--- a/lisp/play/emoji.el
+++ b/lisp/play/emoji.el
@@ -391,14 +391,13 @@ We prefer the earliest unique letter."
   "Add example emojis to the name."
   (let ((name (concat (car entry) " "))
         (children (emoji--flatten entry))
-        (max 20))
+        (max 30))
     (cl-loop for i from 0 upto 20
-             ;; Make the name at most 18 characters long, and choose
-             ;; from all the children.
-             while (< (length name) max)
+             ;; Choose from all the children.
+             while (< (string-width name) max)
              do (cl-loop for child in children
                          for char = (elt child i)
-                         while (< (length name) max)
+                         while (< (string-width name) max)
                          when char
                          do (setq name (concat name char))))
     (if (= (length name) max)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]