aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-lib.el
diff options
context:
space:
mode:
authorGravatar David Edmondson <dme@dme.org>2010-04-22 10:03:32 +0100
committerGravatar Carl Worth <cworth@cworth.org>2010-04-23 15:41:33 -0700
commit45ad21fba18730cdf76725b8a132fc52ba4190a7 (patch)
tree26acdbd2f7f028c301441d4a96417049eb94d61f /emacs/notmuch-lib.el
parentf106db3e9b146b4a032fbeeca8e3cf864abc1894 (diff)
emacs: Re-arrange message sending code
Define a new `mail-user-agent' (`notmuch-user-agent') and use it by default. Re-arrange various routines that send mail to use this (compose, reply, forward). Insert a `User-Agent:' header by default. This is the real commit for this functionality this time. The previous attempt to merge this code: commit 57926bc7b0f784cbacb620fda0ee5157e2e0ff27 was botched (by Carl Worth, not David) to include only the Makefile change. So the build was broken until this commit that actually adds the new file.
Diffstat (limited to 'emacs/notmuch-lib.el')
-rw-r--r--emacs/notmuch-lib.el16
1 files changed, 16 insertions, 0 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index 274d7ec5..47c74b9e 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -33,6 +33,22 @@
: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 ()