summaryrefslogtreecommitdiffhomepage
path: root/notmuch.org
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2021-07-29 02:53:40 +0100
committerjao <jao@gnu.org>2021-07-29 02:53:40 +0100
commitf9fffedbd76d2450abe68d832cd868afb9fccf48 (patch)
treeafa902f303776717cb287866fcdde8a9c466e870 /notmuch.org
parentfca520578129597fd5545811e770a87abb21bdf6 (diff)
downloadelibs-f9fffedbd76d2450abe68d832cd868afb9fccf48.tar.gz
elibs-f9fffedbd76d2450abe68d832cd868afb9fccf48.tar.bz2
notmuch: more address cleaning
Diffstat (limited to 'notmuch.org')
-rw-r--r--notmuch.org6
1 files changed, 5 insertions, 1 deletions
diff --git a/notmuch.org b/notmuch.org
index 20ddebc..1f92de7 100644
--- a/notmuch.org
+++ b/notmuch.org
@@ -180,6 +180,10 @@
(define-key message-mode-map (kbd "C-c C-d")
#'notmuch-draft-postpone)))
+ (defconst jao-mail-clean-rx
+ (regexp-opt '("ElDiario.es - ElDiario.es: " "The Guardian: "
+ "The Conversation – Articles (UK): ")))
+
(defun jao-mail-clean-address (fun address)
(let ((address
(if (string-match ".+ updates on arXiv.org: \\(.+\\)" address)
@@ -188,7 +192,7 @@
(let ((shr-width 1000))
(shr-render-region (point-min) (point-max)))
(replace-regexp-in-string "\"" "" (buffer-string)))
- (string-replace "ElDiario.es - ElDiario.es" "D" address))))
+ (replace-regexp-in-string jao-mail-clean-rx "" address))))
(funcall fun address)))
(advice-add 'notmuch-clean-address :around #'jao-mail-clean-address)