From a98c5182a589b88d73f289ebf741612bd7b924b9 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sun, 7 May 2023 20:19:09 +0200 Subject: if-let for translate-toot --- lisp/mastodon-toot.el | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index f07e61a..8474bca 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -531,13 +531,12 @@ Uses `lingva.el'." (if (not (require 'lingva nil :no-error)) (message "Looks like you need to install lingva.el first.") (if mastodon-tl--buffer-spec - (let ((toot (mastodon-tl--property 'toot-json))) - (if toot - (lingva-translate nil - (mastodon-tl--content toot) - (when mastodon-tl--enable-proportional-fonts - t)) - (message "No toot to translate?"))) + (if-let ((toot (mastodon-tl--property 'toot-json))) + (lingva-translate nil + (mastodon-tl--content toot) + (when mastodon-tl--enable-proportional-fonts + t)) + (message "No toot to translate?")) (message "No mastodon buffer?")))) (defun mastodon-toot--own-toot-p (toot) -- cgit v1.2.3