diff options
author | jao <jao@gnu.org> | 2022-05-28 18:11:53 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-05-28 18:13:17 +0100 |
commit | d0dc577d95791ed32158a008e98273dd414f7f49 (patch) | |
tree | fc5ab5c3b2f9826c5d88dd919f61b257cd973feb | |
parent | f35c9105509b1c5e01081cf413c68cec575a9047 (diff) | |
download | elibs-d0dc577d95791ed32158a008e98273dd414f7f49.tar.gz elibs-d0dc577d95791ed32158a008e98273dd414f7f49.tar.bz2 |
notmuch: format author according to width rather than length
-rw-r--r-- | lib/net/jao-notmuch.el | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/lib/net/jao-notmuch.el b/lib/net/jao-notmuch.el index 6344eab..d5a312d 100644 --- a/lib/net/jao-notmuch.el +++ b/lib/net/jao-notmuch.el @@ -415,7 +415,7 @@ (jao-notmuch-tree--next nil nil t t))) (defvar jao-notmuch-mua-reply-not-inherited - '("attachment" "sent" "new" "unread")) + '("attachment" "sent" "new" "unread" "bigml" "jao")) (defun jao-notmuch--append-to-fcc (suffix) (mapcar (lambda (e) @@ -441,6 +441,18 @@ (seq-sort-by #'length #'<)))) (format-spec fmt `((?s . ,(mapconcat #'identity ts " ")))))) +(defun jao-notmuch-format-author (width msg) + (let* ((headers (plist-get msg :headers)) + (auth (notmuch-tree-clean-address (plist-get headers :From))) + (awidth (string-width auth)) + (auth (if (> awidth width) + (substring auth 0 width) + (concat auth (make-string (- width awidth) 32)))) + (face (if (plist-get msg :match) + 'notmuch-tree-match-author-face + 'notmuch-tree-no-match-author-face))) + (propertize auth 'face face))) + (defun jao-notmuch-tree-and-subject (fmt msg) (let ((tr (notmuch-tree-format-field "tree" " %s" msg)) (sb (notmuch-tree-format-field "subject" " %s" msg))) |