diff options
author | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-03-29 13:37:48 +0200 |
---|---|---|
committer | marty hiatt <martianhiatus [a t] riseup [d o t] net> | 2023-03-29 17:15:04 +0200 |
commit | 97bd086e4c2269bf6cfe453675bbf7f1210b5355 (patch) | |
tree | 3dc38a3331215d2afaef0f01df1613ffe43ba66d | |
parent | 002720dd88037c25f1a40c32d30cc5cb44db645d (diff) |
user-handles-get: return immediately if only one candidate
FIX #420.
-rw-r--r-- | lisp/mastodon-tl.el | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index c929502..60ebc80 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1920,13 +1920,16 @@ LANGS is the accumulated array param alist if we re-run recursively." (t (mastodon-profile--extract-users-handles (mastodon-profile--toot-json)))))) - (completing-read (if (or (equal action "disable") - (equal action "enable")) - (format "%s notifications when user posts: " action) - (format "Handle of user to %s: " action)) - user-handles - nil ; predicate - 'confirm)))) + ;; return immediately if only 1 handle: + (if (eq 1 (length user-handles)) + (car user-handles) + (completing-read (if (or (equal action "disable") + (equal action "enable")) + (format "%s notifications when user posts: " action) + (format "Handle of user to %s: " action)) + user-handles + nil ; predicate + 'confirm))))) (defun mastodon-tl--interactive-blocks-or-mutes-list-get (action) "Fetch the list of accounts for ACTION from the server. |