mu4e-main: use string-width' over length'

Better for utf-8 but still difficult to align due to non-monospaced
characters.
This commit is contained in:
Sean Farley
2020-05-12 22:37:07 -07:00
committed by Dirk-Jan C. Binnema
parent d68c0fd5b5
commit 3ea1784aad
2 changed files with 3 additions and 3 deletions

View File

@ -146,7 +146,7 @@ clicked."
(count (plist-get (car qcounts) :count))) (count (plist-get (car qcounts) :count)))
(format (format
"%s (%s/%s)" "%s (%s/%s)"
(make-string (- longest (length name)) ? ) (make-string (- longest (string-width name)) ? )
(propertize (number-to-string unread) (propertize (number-to-string unread)
'face 'mu4e-header-key-face) 'face 'mu4e-header-key-face)
count)) count))
@ -183,7 +183,7 @@ clicked."
(count (plist-get (car qcounts) :count))) (count (plist-get (car qcounts) :count)))
(format (format
"%s (%s/%s)" "%s (%s/%s)"
(make-string (- longest (length name)) ? ) (make-string (- longest (string-width name)) ? )
(propertize (number-to-string unread) (propertize (number-to-string unread)
'face 'mu4e-header-key-face) 'face 'mu4e-header-key-face)
count)) count))

View File

@ -866,7 +866,7 @@ This is meant to be the exact same data structure as
"Return the length of longest name of bookmarks and maildirs." "Return the length of longest name of bookmarks and maildirs."
(cl-loop for b in (append (mu4e-bookmarks) (cl-loop for b in (append (mu4e-bookmarks)
(mu4e~maildirs-with-query)) (mu4e~maildirs-with-query))
maximize (length (plist-get b :name)))) maximize (string-width (plist-get b :name))))
;;; Indexing & Updating ;;; Indexing & Updating