aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2023-08-27 22:39:45 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2023-08-27 22:54:34 -0400
commit123c7cf0a5ad4ab3f6eb86fd18daefa37e29d253 (patch)
treed9225278cea5e1a0588ca8c9de0e0902647eed2c
parent6360c8b9d06cdbebaa8254abdbc8f70550c78507 (diff)
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).
-rw-r--r--lisp/mastodon-auth.el6
-rw-r--r--lisp/mastodon-profile.el2
-rw-r--r--lisp/mastodon-tl.el2
-rw-r--r--lisp/mastodon-toot.el2
-rw-r--r--lisp/mastodon-views.el4
5 files changed, 7 insertions, 9 deletions
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 8db889c..dadc7a8 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2201,7 +2201,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)))