From 135443c63d26d0b77be5370e693aff8643d5078b Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 18 Mar 2023 21:32:26 +0100 Subject: factor out -tl--map-get-accts --- lisp/mastodon-tl.el | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 61c612a..6e80db3 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1504,6 +1504,13 @@ timeline." ;;; UTILITIES +;; consider having this return an id / acct alist +(defun mastodon-tl--map-get-accts (alist) + "Return a list of handles from ALIST." + (mapcar (lambda (x) + (alist-get 'acct x)) + alist)) + (defun mastodon-tl--symbol (name) "Return the unicode symbol (as a string) corresponding to NAME. If symbol is not displayable, an ASCII equivalent is returned. If @@ -1872,9 +1879,7 @@ Action must be either \"unblock\" or \"unmute\"." "mutes"))) (url (mastodon-http--api endpoint)) (json (mastodon-http--get-json url)) - (accts (mapcar (lambda (user) - (alist-get 'acct user)) - json))) + (accts (mastodon-tl--map-get-accts json))) (when accts (completing-read (format "Handle of user to %s: " action) accts -- cgit v1.2.3