From df32aeaa2bcad47bd5d8bed21a10cdd68e2670f0 Mon Sep 17 00:00:00 2001 From: Sebastian Schulze Date: Wed, 9 Nov 2022 16:24:34 +0100 Subject: [PATCH] [emacs] Fix mu4e-change-from-to-catchall to access message fields via plist --- dot_doom.d/config.el.tmpl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/dot_doom.d/config.el.tmpl b/dot_doom.d/config.el.tmpl index 58e7e23..af1d9b1 100644 --- a/dot_doom.d/config.el.tmpl +++ b/dot_doom.d/config.el.tmpl @@ -209,12 +209,12 @@ (magit-status-setup-buffer)))) (defun bascht/mu4e-change-from-to-catchall (msg) - "Set the From address based on the To address of the original message." - (when msg - (setq user-mail-address - (cond - ((mu4e-message-contact-field-matches msg :to "bascht.com") (cdr-safe (car-safe (mu4e-message-field msg :to)))) - (t user-mail-address))))) + "Set the From address based on the To address of the original message if I reply." + (setq user-mail-address + (if (and msg (mu4e-message-contact-field-matches msg :to "bascht.com")) + (plist-get (car-safe (mu4e-message-field msg :to)) :email) + (cdr-safe (assoc 'user-mail-address (mu4e-context-vars (mu4e-context-current))))))) + (after! mu4e (setq org-msg-signature (with-current-buffer (find-file-noselect "/home/bascht/.signature") (buffer-string))