From 792e18037d2de677d969cabd19bdf1086e760218 Mon Sep 17 00:00:00 2001 From: David Edmondson Date: Tue, 19 Dec 2023 18:39:02 +0000 Subject: 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'. --- lisp/mastodon-auth.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp') 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. -- cgit v1.2.3