diff --git a/mu4e/mu4e-compose.el b/mu4e/mu4e-compose.el index a57225e6..9af94066 100644 --- a/mu4e/mu4e-compose.el +++ b/mu4e/mu4e-compose.el @@ -456,7 +456,8 @@ buffers; lets remap its faces so it uses the ones for mu4e." (setq message-default-charset 'utf-8)) ;; make sure mu4e is started in the background (ie. we don't want to error ;; out when sending the message; better to do it now if there's a problem) - (mu4e~start) ;; start mu4e in background, if needed + (unless (mu4e-running-p) + (mu4e~start)) ;; start mu4e in background, if needed (mu4e~compose-register-message-save-hooks) ;; set the default directory to the user's home dir; this is probably more ;; useful e.g. when finding an attachment file the directory the current diff --git a/mu4e/mu4e-context.el b/mu4e/mu4e-context.el index 9107daef..15af96da 100644 --- a/mu4e/mu4e-context.el +++ b/mu4e/mu4e-context.el @@ -239,7 +239,7 @@ non-nil." "When contexts are defined but there is no context yet, switch to the first whose :match-func return non-nil. If none of them match, return the first. For MSG and POLICY, see `mu4e-context-determine'." - (when (and mu4e-contexts (not mu4e~context-current)) + (when mu4e-contexts (let ((context (mu4e-context-determine msg policy))) (when context (mu4e-context-switch nil (mu4e-context-name context)))))) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index 2eb8106d..01cd44a0 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -780,7 +780,8 @@ nothing." "Handle 'pong' responses from the mu server." (setq mu4e~server-props (plist-get data :props)) ;; save info from the server (let ((doccount (plist-get mu4e~server-props :doccount))) - (mu4e~context-autoswitch nil mu4e-context-policy) + (unless (mu4e-context-current) + (mu4e~context-autoswitch nil mu4e-context-policy)) (mu4e~check-requirements) (when func (funcall func)) (when (zerop doccount)