diff --git a/mu/mu-cmd-server.cc b/mu/mu-cmd-server.cc index fa64e9a5..a86c87d5 100644 --- a/mu/mu-cmd-server.cc +++ b/mu/mu-cmd-server.cc @@ -213,6 +213,10 @@ struct Context { GError *gerr{}; store = mu_store_new_writable (dbpath, NULL); if (!store) { + const auto mu_init = format("mu init %s%s", + opts->muhome ? "--muhome=" : "", + opts->muhome ? opts->muhome : ""); + if (gerr) { if ((MuError)gerr->code == MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK) print_error(MU_ERROR_XAPIAN_CANNOT_GET_WRITELOCK, @@ -221,14 +225,17 @@ struct Context { else print_error((MuError)gerr->code, "cannot open database @ %s:%s; " - "please try 'mu init", dbpath, - gerr->message ? gerr->message : "something went wrong"); + "please try '%s", dbpath, + gerr->message ? gerr->message : "something went wrong", + mu_init.c_str()); } else print_error(MU_ERROR, - "cannot open database @ %s; pleasy try 'mu init'", dbpath); + "cannot open database @ %s; please try '%s'", + dbpath, mu_init.c_str()); throw Mu::Error (Error::Code::Store, &gerr/*consumed*/, - "failed to open database @ %s; please try 'mu init'", dbpath); + "failed to open database @ %s; please try '%s'", + dbpath, mu_init.c_str()); } query = mu_query_new (store, &gerr); diff --git a/mu4e/mu4e-proc.el b/mu4e/mu4e-proc.el index cdc780b4..5bbc26e8 100644 --- a/mu4e/mu4e-proc.el +++ b/mu4e/mu4e-proc.el @@ -252,7 +252,8 @@ Start the process if needed." (unless (file-executable-p mu4e-mu-binary) (mu4e-error (format "`mu4e-mu-binary' (%S) not found" mu4e-mu-binary))) (let* ((process-connection-type nil) ;; use a pipe - (args '("server"))) + (args (when mu4e-mu-home `(,(format"--muhome=%s" mu4e-mu-home)))) + (args (cons "server" args))) (setq mu4e~proc-buf "") (setq mu4e~proc-process (apply 'start-process mu4e~proc-name mu4e~proc-name