From 77fac38771d33a0bc2273e44927318de5393b524 Mon Sep 17 00:00:00 2001 From: Miranda Marquez Date: Sun, 15 Sep 2024 12:28:26 -0800 Subject: [PATCH] animated emoji! but at what cost... --- sharkey.el | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/sharkey.el b/sharkey.el index 228c3b0..7588516 100644 --- a/sharkey.el +++ b/sharkey.el @@ -8,10 +8,13 @@ (mastodon-tl--show-avatars t) (mastodon-toot--enable-custom-instance-emoji t) (mastodon-use-emojify t) + (image-use-external-converter t) :demand) ;; 日本語 +(require 'shr) + ;; need to figure out custom emoji resolution ;; let's start by making :rena: render as the rena.webp image... @@ -58,12 +61,17 @@ returns nil if such an emoji does not exist." (let* ((beg (match-beginning 0)) (end (match-end 0)) (emoj (match-string 1)) - (img (create-image (sharkey--emoji-cache emoj) nil nil + (img (create-image (sharkey--emoji-cache emoj) + (if (image-type-available-p 'imagemagick) + 'imagemagick + 'webp) + nil :height (window-font-height) :ascent 'center)) (ov (make-overlay beg end))) + (image-animate img nil t) (overlay-put ov 'display img) - (overlay-put ov 'face 'default) + ;; (overlay-put ov 'face 'default) (overlay-put ov 'help-echo emoj) (overlay-put ov 'org-image-overlay t) (overlay-put ov 'modification-hooks @@ -95,6 +103,7 @@ returns nil if such an emoji does not exist." ;; (overlay-put text-ov 'help-echo text) ;; (put-text-property text-beg text-end 'display '(height 0.8)) (overlay-put placehoverlay 'display '(height 0.8)) + (overlay-put placehoverlay 'mfm-tag "small") (overlay-put placehoverlay 'modification-hooks (list 'mir/remove-all-overlays @@ -124,13 +133,10 @@ returns nil if such an emoji does not exist." (overlay-end overlay))) (defface mfm-delimiter-invis-face '((t (:string ""))) - "Face for misskey markdown elements such as type stuff.") + "Face for misskey markdown elements such as type stuff.") -;; the fact is, this :neofox: is smolthis :neocat: is also smol apparently -;; -;; this comment is entirely small -; +;; the fact is, this :neofox: is extra smol <-- she should render double small +;; this :neocat: is also smol