From 41f0c5a92afcf6be1b44691931e873270b0dd29e Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Fri, 24 Apr 2020 22:14:41 -0700 Subject: [PATCH] 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. --- mu4e/mu4e-utils.el | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index 437efb72..882b7f90 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -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