diff --git a/mu4e/mu4e-server.el b/mu4e/mu4e-server.el index cb0546ac..65ad3209 100644 --- a/mu4e/mu4e-server.el +++ b/mu4e/mu4e-server.el @@ -396,22 +396,23 @@ As per issue #2198." (defun mu4e--version-check () ;; sanity-check 1 - (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) - (mu4e-error - "Cannot find mu, please set `mu4e-mu-binary' to the mu executable path")) - ;; sanity-check 2 - (let ((version (let ((s (shell-command-to-string - (concat mu4e-mu-binary " --version")))) - (and (string-match "version \\([.0-9]+\\)" s) - (match-string 1 s))))) - (if (not (string= version mu4e-mu-version)) + (let ((default-directory temporary-file-directory)) ;;ensure it's local. + (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) (mu4e-error - (concat - "Found mu version %s, but mu4e needs version %s" - "; please set `mu4e-mu-binary' " - "accordingly") - version mu4e-mu-version) - (mu4e-message "Found mu version %s" version)))) + "Cannot find mu, please set `mu4e-mu-binary' to the mu executable path")) + ;; sanity-check 2 + (let ((version (let ((s (shell-command-to-string + (concat mu4e-mu-binary " --version")))) + (and (string-match "version \\([.0-9]+\\)" s) + (match-string 1 s))))) + (if (not (string= version mu4e-mu-version)) + (mu4e-error + (concat + "Found mu version %s, but mu4e needs version %s" + "; please set `mu4e-mu-binary' " + "accordingly") + version mu4e-mu-version) + (mu4e-message "Found mu version %s" version))))) (defun mu4e-server-repl () "Start a mu4e-server repl. @@ -433,24 +434,23 @@ You cannot run the repl when mu4e is running (or vice-versa)." (defun mu4e--server-start () "Start the mu server process." (mu4e--version-check) - (let ((default-directory temporary-file-directory)) ;;ensure it's local. - ;; kill old/stale servers, if any. - (mu4e--kill-stale) - (let* ((process-connection-type nil) ;; use a pipe - (args (mu4e--server-args))) - (setq mu4e--server-buf "") - (mu4e-log 'misc "* invoking '%s' with parameters %s" mu4e-mu-binary - (mapconcat (lambda (arg) (format "'%s'" arg)) args " ")) - (setq mu4e--server-process (apply 'start-process - mu4e--server-name mu4e--server-name - mu4e-mu-binary args)) - ;; register a function for (:info ...) sexps - (unless mu4e--server-process - (mu4e-error "Failed to start the mu4e backend")) - (set-process-query-on-exit-flag mu4e--server-process nil) - (set-process-coding-system mu4e--server-process 'binary 'utf-8-unix) - (set-process-filter mu4e--server-process 'mu4e--server-filter) - (set-process-sentinel mu4e--server-process 'mu4e--server-sentinel)))) + ;; kill old/stale servers, if any. + (mu4e--kill-stale) + (let* ((process-connection-type nil) ;; use a pipe + (args (mu4e--server-args))) + (setq mu4e--server-buf "") + (mu4e-log 'misc "* invoking '%s' with parameters %s" mu4e-mu-binary + (mapconcat (lambda (arg) (format "'%s'" arg)) args " ")) + (setq mu4e--server-process (apply 'start-process + mu4e--server-name mu4e--server-name + mu4e-mu-binary args)) + ;; register a function for (:info ...) sexps + (unless mu4e--server-process + (mu4e-error "Failed to start the mu4e backend")) + (set-process-query-on-exit-flag mu4e--server-process nil) + (set-process-coding-system mu4e--server-process 'binary 'utf-8-unix) + (set-process-filter mu4e--server-process 'mu4e--server-filter) + (set-process-sentinel mu4e--server-process 'mu4e--server-sentinel))) (defun mu4e--server-kill () "Kill the mu server process."