diff options
author | jao <jao@gnu.org> | 2022-01-12 23:48:56 +0000 |
---|---|---|
committer | jao <jao@gnu.org> | 2022-01-12 23:48:56 +0000 |
commit | 725e86ae70a3d5ae93b2a6c337943f32d2b278d2 (patch) | |
tree | a890975a047917f60d848e3b2cc4d819a201de0b | |
parent | 9e8f967ba282f9e582807ce3de7fc63ab38fee33 (diff) | |
download | elibs-725e86ae70a3d5ae93b2a6c337943f32d2b278d2.tar.gz elibs-725e86ae70a3d5ae93b2a6c337943f32d2b278d2.tar.bz2 |
jao-message-to-from utilitiy
-rw-r--r-- | email.org | 15 |
1 files changed, 14 insertions, 1 deletions
@@ -76,7 +76,7 @@ (setq message-expand-name-standard-ui t) #+end_src -*** Bcc +*** To->From and Bcc #+begin_src emacs-lisp (defvar jao-message--bcc-rx (regexp-opt '("mail.io" "gnu.org"))) @@ -87,6 +87,19 @@ (add-hook 'message-header-setup-hook #'jao-message-insert-bcc) + (defvar jao-message-to-from nil) + + (defun jao-message-adjust-from () + (let ((to (concat (message-fetch-field "To") (message-fetch-field "Cc")))) + (when-let* ((tf (seq-find (lambda (tf) (string-match-p (car tf) to)) + jao-message-to-from)) + (from (message-make-from "Jose A Ortega Ruiz" (cdr tf)))) + (save-restriction + (widen) + (message-replace-header "From" from))))) + + (add-hook 'message-header-setup-hook #'jao-message-adjust-from) + #+end_src *** Encryption #+begin_src emacs-lisp |