Only load notmuch tab-bar if notmuch is in $PATH

This commit is contained in:
Case Duckworth 2022-04-01 18:55:19 -05:00
parent f75a2fc9e3
commit 9742b1a3c8
1 changed files with 2 additions and 1 deletions

View File

@ -52,7 +52,8 @@
(defun +tab-bar-notmuch-count ()
"Display a notmuch count in the tab-bar."
(when (featurep 'notmuch)
(when (and (executable-find "notmuch")
(featurep 'notmuch))
(let* ((counts (notmuch-hello-query-counts notmuch-saved-searches))
(next (cl-find "inbox" counts :key (lambda (l) (plist-get l :name)) :test 'equal))
(next-count (plist-get next :count)))