diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-04 16:23:54 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-10-04 16:23:54 +0200 |
commit | 0aa39f5f1451b7eb58954516a9b2a8b9be6dc16a (patch) | |
tree | 901e877b9db967a80c6bf6180b10c477f856be42 /lisp | |
parent | 63f55bb016865b88f7df295e9d50a9e64403a474 (diff) |
mastodon-toot--enable-custom-emoji: performance improvement.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-toot.el | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index a8c85d8..f7d4f18 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -758,12 +758,17 @@ to `emojify-user-emojis', and the emoji data is updated." (when (y-or-n-p "Looks like you haven't downloaded your instance's custom emoji yet. Download now? ") (mastodon-toot--download-custom-emoji))) - (setq emojify-user-emojis - (append (mastodon-toot--collect-custom-emoji) - emojify-user-emojis)) - ;; if already loaded, reload - (when (featurep 'emojify) - (emojify-set-emoji-data))) + ;; FIXME this test is awful, only works if we were last to mod the list: + (unless (equal (car (mastodon-toot--collect-custom-emoji)) + (car emojify-user-emojis)) + (setq emojify-user-emojis + (append (mastodon-toot--collect-custom-emoji) + emojify-user-emojis)) + ;; if already loaded, reload + (when (featurep 'emojify) + ;; we now only do this within the unless test above, as it is extremely + ;; slow and runs in `mastodon-mode-hook'. + (emojify-set-emoji-data)))) (defun mastodon-toot--remove-docs () "Get the body of a toot from the current compose buffer." |