aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs
diff options
context:
space:
mode:
authorGravatar David Bremner <david@tethera.net>2014-01-26 14:36:37 -0400
committerGravatar David Bremner <david@tethera.net>2014-01-26 15:10:30 -0400
commit71d809ac9ad1dd6c3a88ea8754eb52ef4aba2083 (patch)
tree0fee5b5e70d4d0858f0b51e7759e40f00ce64284 /emacs
parent71d6a405815d8c7894e7241a944ff782eb886245 (diff)
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.
Diffstat (limited to 'emacs')
-rw-r--r--emacs/notmuch-lib.el7
1 files changed, 7 insertions, 0 deletions
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