From cba3982050c879fdebe10e9f6f64bd7721a8fb51 Mon Sep 17 00:00:00 2001 From: mousebot Date: Wed, 3 Nov 2021 09:22:04 +0100 Subject: fix broken completion, restore search--get-user-info{-@} we need this modified version of -get-user-info because it adds the @ prefix to the account handle, which our completion prefix also contains --- lisp/mastodon-search.el | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'lisp') diff --git a/lisp/mastodon-search.el b/lisp/mastodon-search.el index 2227d79..5f52bb7 100644 --- a/lisp/mastodon-search.el +++ b/lisp/mastodon-search.el @@ -46,6 +46,12 @@ ;; functions for company completion of mentions in mastodon-toot +(defun mastodon-search--get-user-info-@ (account) + "Get user handle, display name and account URL from ACCOUNT." + (list (cdr (assoc 'display_name account)) + (concat "@" (cdr (assoc 'acct account))) + (cdr (assoc 'url account)))) + (defun mastodon-search--search-accounts-query (query) "Prompt for a search QUERY and return accounts synchronously. Returns a nested list containing user handle, display name, and URL." @@ -55,7 +61,7 @@ Returns a nested list containing user handle, display name, and URL." (response (if (equal mastodon-toot--enable-completion-for-mentions "following") (mastodon-http--get-search-json url query "following=true") (mastodon-http--get-search-json url query)))) - (mapcar #'mastodon-search--get-user-info + (mapcar #'mastodon-search--get-user-info-@ response))) ;; functions for mastodon search -- cgit v1.2.3