]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
notmuch-hello: Add a 'G' keybinding.
[notmuch] / emacs / notmuch-lib.el
index f4454be61610c25defd5d36b0df31b81002b860d..3b26aca83f771a9b94add3ff601e50f6dbba7123 100644 (file)
 (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)
+(defcustom notmuch-search-oldest-first t
+  "Show the oldest mail first when searching."
+  :type 'boolean
+  :group 'notmuch)
+
+;;
+
+(declare-function notmuch-poll ())
+
+(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.