diff --git a/README.org b/README.org index ec5c648c..76675655 100644 --- a/README.org +++ b/README.org @@ -99,6 +99,22 @@ $ meson compile -C build $ meson install -C build #+end_example +** Windows + +It is possible to make ~mu4e~ on Windows communicate with ~mu~ running in WSL, +side-stepping the issue of compiling ~mu~ on windows. Assuming you have installed +~mu~ in WSL and added to ~$PATH~, here's a sample configuration. + +#+begin_src emacs-lisp +(use-package mu4e + :load-path "//wsl.localhost/Ubuntu/path/to/mu4e" + :config + (setq mu4e-mu-binary "wsl mu")) +#+end_src + +Launching ~mu4e~ from any buffer under ~//wsl.localhost/Ubuntu~ should work then. +For more information on why this works, look at [[https://github.com/djcb/mu/pull/2624][this PR]]. + ** Contributing Contributions are welcome! See the Github issue list and [[IDEAS.org]]. diff --git a/mu4e/mu4e-server.el b/mu4e/mu4e-server.el index 11a6c177..9f6b10bd 100644 --- a/mu4e/mu4e-server.el +++ b/mu4e/mu4e-server.el @@ -436,7 +436,7 @@ As per issue #2198." (defun mu4e--version-check () ;; sanity-check 1 (let ((default-directory temporary-file-directory)) ;;ensure it's local. - (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) + (unless mu4e-mu-binary (mu4e-error "Cannot find mu, please set `mu4e-mu-binary' to the mu executable path")) ;; sanity-check 2 @@ -480,9 +480,9 @@ You cannot run the repl when mu4e is running (or vice-versa)." (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)) + (setq mu4e--server-process (start-process-shell-command + mu4e--server-name mu4e--server-name + (concat mu4e-mu-binary " " (mapconcat #'shell-quote-argument args " ")))) ;; register a function for (:info ...) sexps (unless mu4e--server-process (mu4e-error "Failed to start the mu4e backend")) diff --git a/mu4e/mu4e.el b/mu4e/mu4e.el index d202a3ce..ffabbb5d 100644 --- a/mu4e/mu4e.el +++ b/mu4e/mu4e.el @@ -94,7 +94,7 @@ Otherwise, completely quit mu4e, including automatic updating." (unless (string= (mu4e-server-version) mu4e-mu-version) (mu4e-error "The mu server has version %s, but we need %s" (mu4e-server-version) mu4e-mu-version))) - (unless (and mu4e-mu-binary (file-executable-p mu4e-mu-binary)) + (unless mu4e-mu-binary (mu4e-error "Please set `mu4e-mu-binary' to the full path to the mu binary")) (dolist (var '(mu4e-sent-folder mu4e-drafts-folder