From 3ea1784aada76b182e5b6b64566c799db821ec6e Mon Sep 17 00:00:00 2001 From: Sean Farley Date: Tue, 12 May 2020 22:37:07 -0700 Subject: [PATCH] mu4e-main: use `string-width' over `length' Better for utf-8 but still difficult to align due to non-monospaced characters. --- mu4e/mu4e-main.el | 4 ++-- mu4e/mu4e-utils.el | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mu4e/mu4e-main.el b/mu4e/mu4e-main.el index 5c695944..fb117c9a 100644 --- a/mu4e/mu4e-main.el +++ b/mu4e/mu4e-main.el @@ -146,7 +146,7 @@ clicked." (count (plist-get (car qcounts) :count))) (format "%s (%s/%s)" - (make-string (- longest (length name)) ? ) + (make-string (- longest (string-width name)) ? ) (propertize (number-to-string unread) 'face 'mu4e-header-key-face) count)) @@ -183,7 +183,7 @@ clicked." (count (plist-get (car qcounts) :count))) (format "%s (%s/%s)" - (make-string (- longest (length name)) ? ) + (make-string (- longest (string-width name)) ? ) (propertize (number-to-string unread) 'face 'mu4e-header-key-face) count)) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index 882b7f90..373fd0ff 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -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." (cl-loop for b in (append (mu4e-bookmarks) (mu4e~maildirs-with-query)) - maximize (length (plist-get b :name)))) + maximize (string-width (plist-get b :name)))) ;;; Indexing & Updating