[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master d0e15c3814 1/2: Make the emoji-zoom commands use a transient map
From: |
Lars Ingebrigtsen |
Subject: |
master d0e15c3814 1/2: Make the emoji-zoom commands use a transient map for repetition |
Date: |
Fri, 1 Jul 2022 05:51:13 -0400 (EDT) |
branch: master
commit d0e15c3814665b57c005b4e05000e712841463f1
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Make the emoji-zoom commands use a transient map for repetition
* lisp/international/emoji.el (emoji-zoom-increase)
(emoji-zoom-decrease): Use a transient map for convenience.
---
lisp/international/emoji.el | 16 ++++++----------
1 file changed, 6 insertions(+), 10 deletions(-)
diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index 6a65bc43dc..b108788571 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -707,10 +707,12 @@ We prefer the earliest unique letter."
;;;###autoload
(defun emoji-zoom-increase (&optional factor)
"Increase the size of the character under point.
-FACTOR is the multiplication factor for the size.
-
-This command will be repeatable if `repeat-mode' is switched on."
+FACTOR is the multiplication factor for the size."
(interactive)
+ (message
+ (substitute-command-keys
+ "Zoom with with \\<emoji-zoom-map>\\[emoji-zoom-increase] and
\\[emoji-zoom-decrease]"))
+ (set-transient-map emoji-zoom-map t)
(let* ((factor (or factor 1.1))
(old (get-text-property (point) 'face))
(height (or (and (consp old)
@@ -728,18 +730,12 @@ This command will be repeatable if `repeat-mode' is
switched on."
(put-text-property (point) (1+ (point))
'rear-nonsticky t)))))
-(put 'emoji-zoom-increase 'repeat-map 'emoji-zoom-map)
-
;;;###autoload
(defun emoji-zoom-decrease ()
- "Decrease the size of the character under point.
-
-This command will be repeatable if `repeat-mode' is switched on."
+ "Decrease the size of the character under point."
(interactive)
(emoji-zoom-increase 0.9))
-(put 'emoji-zoom-decrease 'repeat-map 'emoji-zoom-map)
-
(provide 'emoji)
;;; emoji.el ends here