summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/NEWS5
-rw-r--r--lisp/international/emoji.el16
-rw-r--r--lisp/international/mule-cmds.el3
3 files changed, 22 insertions, 2 deletions
diff --git a/etc/NEWS b/etc/NEWS
index 9adeb47db8c..dc4eb64a63a 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -1022,6 +1022,11 @@ These are bound to 'C-x 8 e +' and 'C-x 8 e -', respectively. They
can be used on any character, but are mainly useful for Emoji.
---
+*** New command 'emoji-zoom-reset'.
+This is bound to 'C-x 8 e 0', and undoes any size changes performed by
+'emoji-zoom-increase' and 'emoji-zoom-decrease'.
+
+---
*** New input method 'emoji'.
This allows you to enter Emoji using short strings, eg ':face_palm:'
or ':scream:'.
diff --git a/lisp/international/emoji.el b/lisp/international/emoji.el
index ffff2aa1236..04854ede6be 100644
--- a/lisp/international/emoji.el
+++ b/lisp/international/emoji.el
@@ -700,7 +700,8 @@ We prefer the earliest unique letter."
(defvar-keymap emoji-zoom-map
"+" #'emoji-zoom-increase
- "-" #'emoji-zoom-decrease)
+ "-" #'emoji-zoom-decrease
+ "0" #'emoji-zoom-reset)
;;;###autoload
(defun emoji-zoom-increase (&optional factor)
@@ -741,6 +742,19 @@ FACTOR is the multiplication factor for the size."
(interactive)
(emoji-zoom-increase 0.9))
+;;;###autoload
+(defun emoji-zoom-reset ()
+ "Reset the size of the character under point."
+ (interactive)
+ (with-silent-modifications
+ (let ((old (get-text-property (point) 'face)))
+ (when (and (consp old)
+ (remove-text-properties (point) (1+ (point)) '(rear-nonsticky nil)))
+ (if (eq (car old) :height)
+ (remove-text-properties (point) (1+ (point)) '(face nil))
+ (add-text-properties (point) (1+ (point)) (list 'face
+ (cdr old))))))))
+
(provide 'emoji)
;;; emoji.el ends here
diff --git a/lisp/international/mule-cmds.el b/lisp/international/mule-cmds.el
index 4e38b13b1a5..3d6d66970d3 100644
--- a/lisp/international/mule-cmds.el
+++ b/lisp/international/mule-cmds.el
@@ -3269,7 +3269,8 @@ single characters to be treated as standing for themselves."
"r" #'emoji-recent
"l" #'emoji-list
"+" #'emoji-zoom-increase
- "-" #'emoji-zoom-decrease))
+ "-" #'emoji-zoom-decrease
+ "0" #'emoji-zoom-reset))
(defface confusingly-reordered
'((((supports :underline (:style wave)))