aboutsummaryrefslogtreecommitdiff
path: root/lisp/mastodon-toot.el
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-05 11:09:29 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-10-05 11:09:29 +0200
commit04978295f62f35e2bcab604957939ad199f8894a (patch)
tree62762f379f1e93a39a842130a54d4f1dc4118275 /lisp/mastodon-toot.el
parentb8517fa6d65c9de75fef4a61742251811e9f2b96 (diff)
enable-custom-emoji: cl-find predicate for unless
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r--lisp/mastodon-toot.el23
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el
index 4c55412..7478037 100644
--- a/lisp/mastodon-toot.el
+++ b/lisp/mastodon-toot.el
@@ -758,17 +758,18 @@ 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)))
- ;; 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))))
+ (let ((masto-emojis (mastodon-toot--collect-custom-emoji)))
+ (unless (cl-find (car masto-emojis)
+ emojify-user-emojis
+ :test #'equal)
+ (setq emojify-user-emojis
+ (append masto-emojis
+ 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."