From 652c17da292065d760d8ad455dba9dd26ac49ba1 Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Mon, 14 Oct 2024 13:26:29 +0200 Subject: card authors tiny clean up. #596. --- lisp/mastodon-tl.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/lisp/mastodon-tl.el b/lisp/mastodon-tl.el index b32fe70..e2cba94 100644 --- a/lisp/mastodon-tl.el +++ b/lisp/mastodon-tl.el @@ -901,17 +901,18 @@ links in the text. If TOOT is nil no parsing occurs." (defun mastodon-tl--insert-card-authors (authors) "Insert a string of card AUTHORS." - (insert - (concat - "\n(Authors: " - (mapconcat #'mastodon-tl--format-card-author authors "\n") - ")\n"))) + (let ((authors-str (format "Author%s: " + (if (< 1 (length authors)) "s" "")))) + (insert + (concat + "\n(" authors-str + (mapconcat #'mastodon-tl--format-card-author authors "\n") + ")\n")))) (defun mastodon-tl--format-card-author (data) "Render card author DATA." - ;; FIXME: update as needed, data contains "name" "url" and "account" - (when (alist-get 'account data) ;.account - (let-alist (alist-get 'account data) ;.account + (when-let ((account (alist-get 'account data))) ;.account + (let-alist account ;.account ;; FIXME: replace with refactored handle render fun ;; in byline refactor branch: (concat -- cgit v1.2.3