emacs-diffs
[Top][All Lists]
Advanced

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

scratch/emoji d1706ae: Don't output two blank lines on some boundaries


From: Lars Ingebrigtsen
Subject: scratch/emoji d1706ae: Don't output two blank lines on some boundaries
Date: Thu, 28 Oct 2021 18:19:26 -0400 (EDT)

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

    Don't output two blank lines on some boundaries
---
 lisp/play/emoji.el | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/lisp/play/emoji.el b/lisp/play/emoji.el
index 7291a8f..ce3b3af 100644
--- a/lisp/play/emoji.el
+++ b/lisp/play/emoji.el
@@ -125,15 +125,17 @@ when the command was issued."
                  (concat name " > " mname))
                'face 'emoji-list-header)
               "\n\n")
-      (cl-loop for i from 1
+      (cl-loop for i from 0
                for glyph in alist
-               do (insert
-                   (propertize
-                    (emoji--fontify-glyph glyph)
-                    'emoji-glyph glyph
-                    'help-echo (emoji--name glyph)))
-               (when (zerop (mod i width))
-                 (insert "\n")))
+               do
+               (when (and (cl-plusp i)
+                          (zerop (mod i width)))
+                 (insert "\n"))
+               (insert
+                (propertize
+                 (emoji--fontify-glyph glyph)
+                 'emoji-glyph glyph
+                 'help-echo (emoji--name glyph))))
       (insert "\n\n"))))
 
 (defun emoji--fontify-glyph (glyph &optional inhibit-derived)



reply via email to

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