diff options
author | David Edmondson <dme@dme.org> | 2023-12-19 18:39:02 +0000 |
---|---|---|
committer | David Edmondson <dme@dme.org> | 2023-12-19 21:16:35 +0000 |
commit | 792e18037d2de677d969cabd19bdf1086e760218 (patch) | |
tree | 6ca12a8bbee5b3b11c5c52ab34eff56a7cc980ff /lisp | |
parent | 6a306afeed60e28f2725a9cc8240b723329d7b4c (diff) |
Use `equal' to access alist entries by `mastodon-instance-url'
If a user re-loads their mastodon.el configuration within an emacs
session after using mastodon.el, the variable `mastodon-instance-url'
may no longer be considered `eq' to the original value, even if they
are the same string.
To avoid this problem, compare using `equal'.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/mastodon-auth.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/mastodon-auth.el b/lisp/mastodon-auth.el index 1a3e539..279377b 100644 --- a/lisp/mastodon-auth.el +++ b/lisp/mastodon-auth.el @@ -172,13 +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)) + (alist-get mastodon-instance-url mastodon-auth--token-alist nil nil #'equal)) ((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)) + (alist-get mastodon-instance-url mastodon-auth--token-alist nil nil #'equal)) ((null mastodon-active-user) ;; user not aware of 2FA-related changes and has not set ;; `mastodon-active-user'. Make user aware and error out. |