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.
This commit is contained in:
David Bremner 2014-01-26 14:36:37 -04:00
parent 71d6a40581
commit 71d809ac9a

View file

@ -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