diff options
author | Holger Dürer <me@hdurer.net> | 2021-11-05 18:33:16 +0100 |
---|---|---|
committer | Holger Dürer <me@hdurer.net> | 2021-11-06 16:15:34 +0100 |
commit | 65f80fd810793638beb6f146b25919bca5c21cfc (patch) | |
tree | 6489b585e2f9bdd69b9febfb4bf737d8b96356ff /lisp/mastodon-toot.el | |
parent | f67114cc6c5c167db7327b6b965839236e0466aa (diff) |
Do a bit if `if` and `progn` sanitizing.
- A `progn` with a single form is redundant
- `when` doesn't need a `progn` body
- `if` has an implicit `progn` for the consequences
- I converted one cascade of `if`s into a `cond`.
Diffstat (limited to 'lisp/mastodon-toot.el')
-rw-r--r-- | lisp/mastodon-toot.el | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index d5f4d78..885db1d 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -373,21 +373,20 @@ To use the downloaded emoji, run `mastodon-toot--enable-custom-emoji'." "mastodon-custom-emojis")))) (if (not (file-directory-p emojify-emojis-dir)) (message "Looks like you need to set up emojify first.") - (progn - (unless (file-directory-p mastodon-custom-emoji-dir) - (make-directory mastodon-custom-emoji-dir nil)) ; no add parent - (mapc (lambda (x) - (url-copy-file (alist-get 'url x) - (concat - mastodon-custom-emoji-dir - (alist-get 'shortcode x) - "." - (file-name-extension (alist-get 'url x))) - t)) - custom-emoji) - (message "Custom emoji for %s downloaded to %s" - mastodon-instance-url - mastodon-custom-emoji-dir))))) + (unless (file-directory-p mastodon-custom-emoji-dir) + (make-directory mastodon-custom-emoji-dir nil)) ; no add parent + (mapc (lambda (x) + (url-copy-file (alist-get 'url x) + (concat + mastodon-custom-emoji-dir + (alist-get 'shortcode x) + "." + (file-name-extension (alist-get 'url x))) + t)) + custom-emoji) + (message "Custom emoji for %s downloaded to %s" + mastodon-instance-url + mastodon-custom-emoji-dir)))) (defun mastodon-toot--collect-custom-emoji () "Return a list of `mastodon-instance-url's custom emoji. |