From 6d3e9cf18a74045e17f8e5c1fc6e20a8c40f497f Mon Sep 17 00:00:00 2001 From: marty hiatt Date: Thu, 1 Sep 2022 17:03:47 +0200 Subject: cl-reduce for metadata fields format --- lisp/mastodon-profile.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/mastodon-profile.el b/lisp/mastodon-profile.el index 25edfba..aa5ec2e 100644 --- a/lisp/mastodon-profile.el +++ b/lisp/mastodon-profile.el @@ -34,6 +34,7 @@ ;;; Code: (require 'seq) +(require 'cl-lib) (autoload 'mastodon-http--api "mastodon-http.el") (autoload 'mastodon-http--get-json "mastodon-http.el") @@ -344,7 +345,8 @@ Returns a list of lists." (defun mastodon-profile--fields-insert (fields) "Format and insert field pairs (a.k.a profile metadata) in FIELDS." (let* ((car-fields (mapcar 'car fields)) - (left-width (car (sort (mapcar 'length car-fields) '>)))) + (left-width (cl-reduce + #'max (mapcar 'length car-fields)))) (mapconcat (lambda (field) (mastodon-tl--render-text (concat -- cgit v1.2.3