mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
emacs: add a function to heuristically test if the CLI is configured OK.
We cache the result so that we can call the function many places without worrying about the cost.
This commit is contained in:
parent
aa57e9d2b8
commit
71d6a40581
1 changed files with 11 additions and 0 deletions
|
@ -168,6 +168,17 @@ Otherwise the output will be returned"
|
|||
(notmuch-check-exit-status status (cons notmuch-command args) output)
|
||||
output)))
|
||||
|
||||
(defvar notmuch--cli-sane-p nil
|
||||
"Cache whether the CLI seems to be configured sanely.")
|
||||
|
||||
(defun notmuch-cli-sane-p ()
|
||||
"Return t if the cli seems to be configured sanely."
|
||||
(unless notmuch--cli-sane-p
|
||||
(let ((status (call-process notmuch-command nil nil nil
|
||||
"config" "get" "user.primary_email")))
|
||||
(setq notmuch--cli-sane-p (= status 0))))
|
||||
notmuch--cli-sane-p)
|
||||
|
||||
(defun notmuch-version ()
|
||||
"Return a string with the notmuch version number."
|
||||
(let ((long-string
|
||||
|
|
Loading…
Reference in a new issue