From: David Bremner Date: Sun, 26 Jan 2014 18:36:37 +0000 (-0400) Subject: emacs: add function notmuch-assert-cli-sane X-Git-Tag: 0.18_rc0~170 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/notmuch.git/commitdiff_plain/71d809ac9ad1dd6c3a88ea8754eb52ef4aba2083 emacs: add function notmuch-assert-cli-sane If the CLI seems borked, signal an error, and log a suggestion for the user about how to recover. --- diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 140d7603..e6e9f97a 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -179,6 +179,13 @@ Otherwise the output will be returned" (setq notmuch--cli-sane-p (= status 0)))) notmuch--cli-sane-p) +(defun notmuch-assert-cli-sane () + (unless (notmuch-cli-sane-p) + (notmuch-logged-error + "notmuch cli seems misconfigured or unconfigured." +"Perhaps you haven't run \"notmuch setup\" yet? Try running this +on the command line, and then retry your notmuch command"))) + (defun notmuch-version () "Return a string with the notmuch version number." (let ((long-string