diff options
author | jao <jao@gnu.org> | 2021-04-23 01:22:39 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2021-04-23 01:23:16 +0100 |
commit | f46b70ad06e1575409a6bf18efcf8165e61cc2ba (patch) | |
tree | f9122a3776ebdf8f39d1e0060a989050cf844c3f | |
parent | 2a7e8c00d8a9fb3c4eb29c19a35ab98943c1f142 (diff) | |
download | elibs-f46b70ad06e1575409a6bf18efcf8165e61cc2ba.tar.gz elibs-f46b70ad06e1575409a6bf18efcf8165e61cc2ba.tar.bz2 |
notmuch: prettier tree index
-rw-r--r-- | email.org | 35 |
1 files changed, 19 insertions, 16 deletions
@@ -523,15 +523,17 @@ :config (defun jao-mail-clean-address (fun address) - (let ((address (if (string-match ".+ updates on arXiv.org: \\(.+\\)" - address) - (with-temp-buffer - (insert (match-string 1 address)) - (let ((shr-width 1000)) - (shr-render-region (point-min) (point-max))) - (buffer-string)) - address))) - (funcall fun address))) + (let ((address (if (string-match ".+ updates on arXiv.org: \\(.+\\)" + address) + (with-temp-buffer + (insert (match-string 1 address)) + (let ((shr-width 1000)) + (shr-render-region (point-min) (point-max))) + (buffer-string)) + (replace-regexp-in-string "^ElDiario.es - ElDiario.es" + "ElDiario.es" + address)))) + (funcall fun address))) (advice-add 'notmuch-clean-address :around #'jao-mail-clean-address) @@ -549,13 +551,13 @@ (setq notmuch-tree-result-format '(("date" . "%12s ") ("authors" . "%-35s") - ((("tree" . "%s ")("subject" . "%s")) . " %-95s") + ((("tree" . "%s ")("subject" . "%s")) . " %-100s") ("tags" . " (%s)")) notmuch-search-result-format '(("date" . "%12s ") ("count" . "%-7s ") ("authors" . "%-35s") - ("subject" . "%-95s") + ("subject" . "%-100s") ("tags" . "(%s)")) notmuch-unthreaded-result-format notmuch-tree-result-format) @@ -574,11 +576,12 @@ (defun jao-notmuch--format-field (fun field &rest args) (let ((rs (apply fun field args))) - (if (and (stringp field) (string= field "tree")) - (thread-last (replace-regexp-in-string "►" "➤" rs) - (replace-regexp-in-string "╰" "├")) - ;; (thread-last (replace-regexp-in-string "►" "➤" rs) - rs))) + (cond ((and (stringp field) (string= field "tree")) + (propertize (replace-regexp-in-string "►" ">" rs) ;; "➤" + 'face + '(:family "Source Code Pro" :foreground "grey60"))) + ((not (stringp field)) (truncate-string-to-width rs 100)) + (t rs)))) (advice-add 'notmuch-tree-format-field :around #'jao-notmuch--format-field) |