X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=47c74b9ef0a4323677000ec2591a85703120bf0f;hb=6408270512dd654243b81ed57b81dad3f721938c;hp=f4454be61610c25defd5d36b0df31b81002b860d;hpb=e2dd4ac00b9979de34bd517fa57de56260d38755;p=notmuch diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index f4454be6..47c74b9e 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -24,16 +24,30 @@ (defvar notmuch-command "notmuch" "Command to run the notmuch binary.") -(declare-function notmuch-toggle-invisible-action "notmuch" (cite-button)) +(defgroup notmuch nil + "Notmuch mail reader for Emacs." + :group 'mail) -(define-button-type 'notmuch-button-invisibility-toggle-type - 'action 'notmuch-toggle-invisible-action - 'follow-link t - 'face 'font-lock-comment-face) +(defcustom notmuch-folders '(("inbox" . "tag:inbox") ("unread" . "tag:unread")) + "List of searches for the notmuch folder view" + :type '(alist :key-type (string) :value-type (string)) + :group 'notmuch) -(define-button-type 'notmuch-button-headers-toggle-type - 'help-echo "mouse-1, RET: Show headers" - :supertype 'notmuch-button-invisibility-toggle-type) +;; + +(defun notmuch-version () + "Return a string with the notmuch version number." + (let ((long-string + ;; Trim off the trailing newline. + (substring (shell-command-to-string + (concat notmuch-command " --version")) + 0 -1))) + (if (string-match "^notmuch\\( version\\)? \\(.*\\)$" + long-string) + (match-string 2 long-string) + "unknown"))) + +;; ;; XXX: This should be a generic function in emacs somewhere, not ;; here.