From aa3ca5e0f446fc06346a49b0cdd4ce1080a0d0e1 Mon Sep 17 00:00:00 2001 From: jao Date: Thu, 9 Sep 2021 02:12:36 +0100 Subject: notmuch tweaks (advice with filter-return/args) --- notmuch.org | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/notmuch.org b/notmuch.org index 0ca72f5..cbfee86 100644 --- a/notmuch.org +++ b/notmuch.org @@ -128,6 +128,10 @@ '(("unread") ("new") (".*" (notmuch-apply-face tag 'notmuch-tag-deleted)))) + + (with-eval-after-load "notmuch-tag" + (advice-add #'notmuch-read-tag-changes + :filter-return (lambda (x) (mapcar #'string-trim x)))) #+end_src * package #+begin_src emacs-lisp @@ -151,7 +155,8 @@ (when (eq 'notmuch jao-afio-mail-function) (setq message-directory "~/var/mail/" - message-auto-save-directory "/tmp")) + message-auto-save-directory "/tmp" + mail-user-agent 'sendmail-user-agent)) :bind (:map notmuch-common-keymap (("E" . jao-notmuch-open-enclosure) @@ -241,17 +246,15 @@ (regexp-opt '("ElDiario.es - ElDiario.es: " "The Guardian: " "The Conversation – Articles (UK): "))) - (defun jao-mail-clean-address (fun address) - (when 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))) - (replace-regexp-in-string "\"" "" (buffer-string))) - (replace-regexp-in-string jao-mail-clean-rx "" address)))) - (funcall fun address)))) + (defun jao-mail-clean-address (args) + (when-let ((address (car args))) + (list (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))) + (replace-regexp-in-string "\"" "" (buffer-string))) + (replace-regexp-in-string jao-mail-clean-rx "" address))))) (defun jao-notmuch-show-setup () (setq header-line-format nil)) @@ -268,7 +271,7 @@ :config - (advice-add 'notmuch-clean-address :around #'jao-mail-clean-address) + (advice-add 'notmuch-clean-address :filter-args #'jao-mail-clean-address) (add-hook 'notmuch-show-hook #'jao-notmuch-show-setup) (jao-notmuch-show-prefer-html) -- cgit v1.2.3