From 40b8fe138ba459d006420d1f68f57abc289b903b Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 13 Dec 2015 17:43:41 +0200 Subject: [PATCH] mu4e: context: auto-detect context using the match function When composing a new message, attempt to auto-detect the context for that, using the context's 'match-func'. --- mu4e/mu4e-compose.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index 98e0483e..64652502 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -367,6 +367,9 @@ tempfile)." ;; message being forwarded or replied to, otherwise it is nil. (set (make-local-variable 'mu4e-compose-parent-message) original-msg) (put 'mu4e-compose-parent-message 'permanent-local t) + (let ((context (mu4e-context-determine mu4e-compose-parent-message))) + (when context + (mu4e-context-switch (mu4e-context-name context)))) (run-hooks 'mu4e-compose-pre-hook) ;; this opens (or re-opens) a messages with all the basic headers set.