From 785d888b4249e8879d847f9e215aec4eda64b20f Mon Sep 17 00:00:00 2001 From: djcb Date: Sun, 3 Jan 2016 15:53:58 +0200 Subject: [PATCH] mu4e: don't change context when already running This is for the case where mu4e-compose trigger mu4e~start, as found by thierryvolpiatto. --- mu4e/mu4e-utils.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/mu4e/mu4e-utils.el b/mu4e/mu4e-utils.el index 26b9e0bf..b3246e76 100644 --- a/mu4e/mu4e-utils.el +++ b/mu4e/mu4e-utils.el @@ -777,14 +777,13 @@ first. If mu4e is already running, execute function FUNC (if non-nil). Otherwise, check various requirements, then start mu4e. When successful, call FUNC (if non-nil) afterwards." - ;; maybe switch the context - (mu4e~context-autoswitch nil mu4e-context-policy) ;; if we're already running, simply go to the main view (if (mu4e-running-p) ;; already running? - (when func ;; yes! run func if defined - (funcall func)) + (when func (funcall func)) ;; yes! run func if defined (progn - ;; no! do some checks, set up pong handler and ping the server + ;; no! try to set a context, do some checks, set up pong handler and ping + ;; the server maybe switch the context + (mu4e~context-autoswitch nil mu4e-context-policy) (lexical-let ((func func)) (mu4e~check-requirements) ;; set up the 'pong' handler func