diff options
author | jao <jao@gnu.org> | 2022-06-04 19:06:53 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-06-04 19:06:53 +0100 |
commit | 59a7ad95c0150094faaf5284781031a360a31a99 (patch) | |
tree | d3069fae40d62f350d6dfe13cb5a40dbb17aebf1 | |
parent | e6519af6c9665eb912384cdd7a88937e618cad41 (diff) | |
download | elibs-59a7ad95c0150094faaf5284781031a360a31a99.tar.gz elibs-59a7ad95c0150094faaf5284781031a360a31a99.tar.bz2 |
better message-dont-reply-to-names integration
-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))))) |