]> git.notmuchmail.org Git - notmuch/blobdiff - emacs/notmuch-lib.el
emacs: Re-arrange message sending code
[notmuch] / emacs / notmuch-lib.el
index 274d7ec5591969ffda7269d2da98fc8b22754d77..47c74b9ef0a4323677000ec2591a85703120bf0f 100644 (file)
   :type '(alist :key-type (string) :value-type (string))
   :group 'notmuch)
 
+;;
+
+(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.
 (defun point-invisible-p ()