diff options
-rw-r--r-- | email.org | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -91,15 +91,18 @@ (add-hook 'message-header-setup-hook #'jao-message-adjust-from)) #+end_src *** Clean up reply addresses - #+begin_src emacs-lisp - (defun jao-message--dont-reply (mail) - (unless (string-match-p message-dont-reply-to-names mail) mail)) + #+begin_src emacs-lisp :tangle no + (defun jao-message--dont-reply () + (let ((x (message-dont-reply-to-names))) + (if (functionp x) + x + (lambda (mail) (unless (string-match-p x mail) mail))))) (defun jao-message-strip-replies () (dolist (header '("To" "Cc")) (when-let ((v (message-fetch-field header))) (let* ((v (message-tokenize-header v)) - (vs (delq nil (mapcar #'jao-message--dont-reply v))) + (vs (delq nil (mapcar (jao-message--dont-reply) v))) (v (when vs (mapconcat #'string-trim vs ", ")))) (message-replace-header header v))))) |