From 0396383c6586dcf5a8f84aa30f597f6dab21d7b8 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 3 Jun 2024 10:30:10 +0200 Subject: editing to preserve polls. create poll plist from JSON. still can't edit actual polls, but can view/clear them, which is much better than zilch. --- lisp/mastodon-tl.el | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lisp/mastodon-tl.el') diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index 7345ea3..573c2fa 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -1220,7 +1220,7 @@ SENSITIVE is a flag from the item's JSON data." (defun mastodon-tl--format-poll-option (option option-counter length) "Format poll OPTION. OPTION-COUNTER is just a counter. -LONGEST-OPTION is the option whose length determines the formatting." +LENGTH is of the longest option, for formatting." (format "%s: %s%s%s\n" option-counter (propertize (alist-get 'title option) @@ -1233,7 +1233,7 @@ LONGEST-OPTION is the option whose length determines the formatting." "0")))) (defun mastodon-tl--format-poll (poll) - "If TOOT includes a poll, return it as a formatted string." + "From json poll data POLL, return a display string." (let-alist poll (let* ((option-titles (mastodon-tl--map-alist 'title .options)) (longest (car (sort (mapcar #'length option-titles) #'>))) -- cgit v1.2.3