aboutsummaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authormarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-24 23:41:47 +0200
committermarty hiatt <martianhiatus [a t] riseup [d o t] net>2023-04-24 23:41:47 +0200
commit71420a495cb1647df67d124dd9a6fe45449612da (patch)
treef89ada793fefee14bfba7d8825a9d5f6e1c7d461 /lisp
parent974127aa02cdddfbe4f40aac3c05ef9da62fd2f3 (diff)
refactor and let-alist for tl--map-rules-alist
Diffstat (limited to 'lisp')
-rw-r--r--lisp/mastodon-tl.el11
1 files changed, 7 insertions, 4 deletions
diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el
index c10c9ec..5175370 100644
--- a/lisp/mastodon-tl.el
+++ b/lisp/mastodon-tl.el
@@ -2178,13 +2178,16 @@ report the account for spam."
(defvar crm-separator)
+(defun mastodon-tl--map-rules-alist (rules)
+ (mapcar (lambda (x)
+ (let-alist x
+ `(,.text . ,.id)))
+ rules))
+
(defun mastodon-tl--read-rules-ids ()
"Prompt for a list of instance rules and return a list of selected ids."
(let* ((rules (mastodon-tl--instance-rules))
- (alist (mapcar (lambda (x)
- (cons (alist-get 'text x)
- (alist-get 'id x)))
- rules))
+ (alist (mastodon-tl--map-rules-alist rules))
(crm-separator (replace-regexp-in-string "," "|" crm-separator))
(choices (completing-read-multiple
"rules [TAB for options, | to separate]: "