mu4e-utils: add method to count the longest name

Consolidates the logic for looping over bookmarks and maildirs so that
we can compute the longest name.
This commit is contained in:
Sean Farley 2020-04-24 22:14:41 -07:00 committed by Dirk-Jan C. Binnema
parent c2b0d2db6e
commit 41f0c5a92a
1 changed files with 5 additions and 0 deletions

View File

@ -862,6 +862,11 @@ This is meant to be the exact same data structure as
append (list key value))))
(mu4e-maildir-shortcuts)))
(defun mu4e~longest-of-maildirs-and-bookmarks ()
"Return the length of longest name of bookmarks and maildirs."
(cl-loop for b in (append (mu4e-bookmarks)
(mu4e~maildirs-with-query))
maximize (length (plist-get b :name))))
;;; Indexing & Updating