From 3212f5dd0b5716e1bb4db60fb65bd950c08ec12a Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Sun, 27 Aug 2023 22:39:45 -0400 Subject: Simplify calls to `alist-get` * lisp/mastodon-toot.el (mastodon-toot--set-toot-language): * lisp/mastodon-tl.el (mastodon-tl--read-rules-ids): * lisp/mastodon-profile.el (mastodon-profile--remove-from-followers-list): * lisp/mastodon-auth.el (mastodon-auth--access-token): * lisp/mastodon-views.el (mastodon-views--add-account-to-list) (mastodon-views--remove-account-from-list): Remove redundant optional arg to `alist-get` (`equal` is already the default). --- lisp/mastodon-auth.el | 6 ++---- lisp/mastodon-profile.el | 2 +- lisp/mastodon-tl.el | 2 +- lisp/mastodon-toot.el | 2 +- lisp/mastodon-views.el | 4 ++-- 5 files changed, 7 insertions(+), 9 deletions(-) (limited to 'lisp') diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index eb57368..5069271 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -172,15 +172,13 @@ When ASK is absent return nil." Generate/save token if none known yet." (cond (mastodon-auth--token-alist ;; user variables are known and initialised. - (alist-get mastodon-instance-url mastodon-auth--token-alist - nil nil 'equal)) + (alist-get mastodon-instance-url mastodon-auth--token-alist)) ((plist-get (mastodon-client--active-user) :access_token) ;; user variables need to be read from plstore. (push (cons mastodon-instance-url (plist-get (mastodon-client--active-user) :access_token)) mastodon-auth--token-alist) - (alist-get mastodon-instance-url mastodon-auth--token-alist - nil nil 'equal)) + (alist-get mastodon-instance-url mastodon-auth--token-alist)) ((null mastodon-active-user) ;; user not aware of 2FA-related changes and has not set ;; `mastodon-active-user'. Make user aware and error out. diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index a5abe5a..658c371 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -827,7 +827,7 @@ Currently limited to 100 handles. If not found, try (response (mastodon-http--get-json url `(("limit" . "100")))) (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id response)) (choice (completing-read "Remove from followers: " handles)) - (id (alist-get choice handles nil nil 'equal))) + (id (alist-get choice handles))) (mastodon-profile--remove-user-from-followers id))) (defun mastodon-profile--add-private-note-to-account () diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 1b53460..de26853 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -2207,7 +2207,7 @@ report the account for spam." "rules [TAB for options, | to separate]: " alist nil t))) (mapcar (lambda (x) - (alist-get x alist nil nil 'equal)) + (alist-get x alist)) choices))) diff --git a/lisp/mastodon-toot.el b/lisp/mastodon-toot.el index 14b9d68..f14aec3 100644 --- a/lisp/mastodon-toot.el +++ b/lisp/mastodon-toot.el @@ -1130,7 +1130,7 @@ Return its two letter ISO 639 1 code." (let* ((choice (completing-read "Language for this toot: " mastodon-iso-639-1))) (setq mastodon-toot--language - (alist-get choice mastodon-iso-639-1 nil nil 'equal)) + (alist-get choice mastodon-iso-639-1)) (message "Language set to %s" choice) (mastodon-toot--update-status-fields))) diff --git a/lisp/mastodon-views.el b/lisp/mastodon-views.el index a40603d..00b9467 100644 --- a/lisp/mastodon-views.el +++ b/lisp/mastodon-views.el @@ -391,7 +391,7 @@ If ACCOUNT-ID and HANDLE are provided use them rather than prompting." (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id followings)) (account (or handle (completing-read "Account to add: " handles nil t))) - (account-id (or account-id (alist-get account handles nil nil 'equal))) + (account-id (or account-id (alist-get account handles))) (url (mastodon-http--api (format "lists/%s/accounts" list-id))) (response (mastodon-http--post url `(("account_ids[]" . ,account-id))))) (mastodon-views--list-action-triage @@ -425,7 +425,7 @@ If ID is provided, use that list." (handles (mastodon-tl--map-alist-vals-to-alist 'acct 'id accounts)) (account (completing-read "Account to remove: " handles nil t)) - (account-id (alist-get account handles nil nil 'equal)) + (account-id (alist-get account handles)) (url (mastodon-http--api (format "lists/%s/accounts" list-id))) (args (mastodon-http--build-array-params-alist "account_ids[]" `(,account-id))) (response (mastodon-http--delete url args))) -- cgit v1.2.3