summaryrefslogtreecommitdiffhomepage
path: root/email.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-04-23 01:22:39 +0100
committerjao <jao@gnu.org>2021-04-23 01:23:16 +0100
commitf46b70ad06e1575409a6bf18efcf8165e61cc2ba (patch)
treef9122a3776ebdf8f39d1e0060a989050cf844c3f /email.org
parent2a7e8c00d8a9fb3c4eb29c19a35ab98943c1f142 (diff)
downloadelibs-f46b70ad06e1575409a6bf18efcf8165e61cc2ba.tar.gz
elibs-f46b70ad06e1575409a6bf18efcf8165e61cc2ba.tar.bz2
notmuch: prettier tree index
Diffstat (limited to 'email.org')
-rw-r--r--email.org35
1 files changed, 19 insertions, 16 deletions
diff --git a/email.org b/email.org
index c7ff6a4..eaac4c2 100644
--- a/email.org
+++ b/email.org
@@ -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)