From 87705c415d6ec3bbf2ed13b844d9c8d1400f1fa4 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 5 Sep 2022 12:50:07 +0200 Subject: use seq-empty-p and string-empty-p calls --- lisp/mastodon-tl.el | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 4b0bd9f..db8ce20 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -271,7 +271,7 @@ text, i.e. hidden spoiler text." (interactive) (let* ((word (or (word-at-point) "")) (input (read-string (format "Load timeline for tag (%s): " word))) - (tag (if (equal input "") word input))) + (tag (if (string-empty-p input) word input))) (message "Loading timeline for #%s..." tag) (mastodon-tl--show-tag-timeline tag))) @@ -338,7 +338,7 @@ Used on initializing a timeline or thread." "Propertize author of TOOT." (let* ((account (alist-get 'account toot)) (handle (alist-get 'acct account)) - (name (if (not (string= "" (alist-get 'display_name account))) + (name (if (not (string-empty-p (alist-get 'display_name account))) (alist-get 'display_name account) (alist-get 'username account))) (profile-url (alist-get 'url account)) @@ -370,12 +370,12 @@ Used on initializing a timeline or thread." (propertize (concat "@" handle) 'face 'mastodon-handle-face 'mouse-face 'highlight - 'mastodon-tab-stop 'user-handle + 'mastodon-tab-stop 'user-handle 'account account - 'shr-url profile-url - 'keymap mastodon-tl--link-keymap + 'shr-url profile-url + 'keymap mastodon-tl--link-keymap 'mastodon-handle (concat "@" handle) - 'help-echo (concat "Browse user profile of @" handle)) + 'help-echo (concat "Browse user profile of @" handle)) ")"))) (defun mastodon-tl--format-faves-count (toot) @@ -878,7 +878,7 @@ message is a link which unhides/hides the main body." (concat "Media::" preview-url "\n")))) media-attachements ""))) (if (not (and mastodon-tl--display-media-p - (equal media-string ""))) + (string-empty-p media-string))) (concat "\n" media-string) ""))) @@ -1272,7 +1272,7 @@ Prompt for a context, must be a list containting at least one of \"home\", (format "Word(s) to filter (%s): " (or (current-word) "")) nil nil (or (current-word) ""))) (contexts - (if (equal "" word) + (if (string-empty-p word) (error "You must select at least one word for a filter") (completing-read-multiple "Contexts to filter [TAB for options]:" @@ -1316,7 +1316,7 @@ JSON is what is returned by by the server." (mastodon-tl--set-face "[c - create filter\n d - delete filter at point\n n/p - go to next/prev filter]\n\n" 'font-lock-comment-face)) - (if (equal json '[]) + (if (seq-empty-p json) (insert (propertize "Looks like you have no filters for now." 'face font-lock-comment-face @@ -1654,7 +1654,7 @@ NOTIFY is only non-nil when called by `mastodon-tl--follow-user'." (mastodon-profile--lookup-account-in-status user-handle (mastodon-profile--toot-json)))) (user-id (mastodon-profile--account-field account 'id)) - (name (if (not (equal "" (mastodon-profile--account-field account 'display_name))) + (name (if (not (string-empty-p (mastodon-profile--account-field account 'display_name))) (mastodon-profile--account-field account 'display_name) (mastodon-profile--account-field account 'username))) (url (mastodon-http--api -- cgit v1.2.3