emacs-diffs
[Top][All Lists]
Advanced

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

scratch/emoji 3fc53d2 1/2: Pass along the end function and keep place in


From: Lars Ingebrigtsen
Subject: scratch/emoji 3fc53d2 1/2: Pass along the end function and keep place in the grid
Date: Tue, 26 Oct 2021 19:13:06 -0400 (EDT)

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

    Pass along the end function and keep place in the grid
---
 lisp/play/emoji.el | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/lisp/play/emoji.el b/lisp/play/emoji.el
index f3eba18..766a086 100644
--- a/lisp/play/emoji.el
+++ b/lisp/play/emoji.el
@@ -62,13 +62,13 @@ when the command was issued."
   (interactive "*")
   (let ((buf (current-buffer)))
     (emoji--init)
-    (pop-to-buffer (get-buffer-create "*Emoji*"))
-    (let ((inhibit-read-only t))
-      (erase-buffer)
-      (emoji-list-mode)
-      (setq-local emoji--insert-buffer buf)
-      (emoji--list-generate nil (cons nil emoji--labels))
-      (goto-char (point-min)))))
+    (switch-to-buffer (get-buffer-create "*Emoji*"))
+    (when (zerop (buffer-size))
+      (let ((inhibit-read-only t))
+        (emoji-list-mode)
+        (setq-local emoji--insert-buffer buf)
+        (emoji--list-generate nil (cons nil emoji--labels))
+        (goto-char (point-min))))))
 
 (defun emoji--list-generate (name alist)
   (let ((width (/ (window-width) 3))
@@ -326,7 +326,7 @@ when the command was issued."
                                       (emoji--define-transient
                                        (cons (concat mname " " char)
                                              (cons char derived))
-                                       'no-derived)
+                                       t end-function)
                                     ;; Insert the emoji.
                                     (lambda ()
                                       (interactive)



reply via email to

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