From d0e15c3814665b57c005b4e05000e712841463f1 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Fri, 1 Jul 2022 11:11:47 +0200 Subject: [PATCH] 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 6a65bc43dc7..b108788571c 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-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 -- 2.39.5