From 5d62213b4f8f92cb974c24c4ab0fc373fe806115 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Sat, 18 Mar 2023 22:17:45 +0100 Subject: refactor tl--map-alist-to-alist --- lisp/mastodon-tl.el | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 95af2f1..91619f1 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1505,6 +1505,14 @@ Key is a symbol, as with `alist-get'." (alist-get key x)) alist)) +(defun mastodon-tl-map-alist-to-alist (key1 key2 alist) + "From ALIST, return an alist consisting of (val1 . val2) elements. +Values are accessed by `alist-get', using KEY1 and KEY2." + (mapcar (lambda (x) + (cons (alist-get key1 x) + (alist-get key2 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 -- cgit v1.2.3