From 71d809ac9ad1dd6c3a88ea8754eb52ef4aba2083 Mon Sep 17 00:00:00 2001 From: David Bremner Date: Sun, 26 Jan 2014 14:36:37 -0400 Subject: [PATCH] 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. --- emacs/notmuch-lib.el | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- 2.43.0