aboutsummaryrefslogtreecommitdiffhomepage
path: root/emacs/notmuch-lib.el
diff options
context:
space:
mode:
authorGravatar Carl Worth <cworth@cworth.org>2010-10-27 16:27:43 -0700
committerGravatar Carl Worth <cworth@cworth.org>2010-10-27 16:27:43 -0700
commit8b6f3e3f458c6ccca49100c5fb224af1aaa2b540 (patch)
treecf5b0701ca553cf01c5eb9eae83c33ee59e10e34 /emacs/notmuch-lib.el
parent65f2e61f28a0f5c5dc38dd3cf8a1de023934b330 (diff)
emacs: Change FCC to be relative to notmuch mail store, not message-directory
Otherwise, FCC is too hard to use, (user must set it and also set message- directory variable to match notmuch mail datbase path). As a rule, I'd like for users of notmuch to not be required to muck around with non-notmuch mail settings in emacs. The above is only really possible now thanks to the recent addition of the "notmuch config get" command which allows emacs to query the currently configured notmuch database path. This also now allows an absolute-path FCC to be set if desired.
Diffstat (limited to 'emacs/notmuch-lib.el')
-rw-r--r--emacs/notmuch-lib.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el
index f30bcb42..91132b50 100644
--- a/emacs/notmuch-lib.el
+++ b/emacs/notmuch-lib.el
@@ -68,6 +68,13 @@ the user hasn't set this variable with the old or new value."
(match-string 2 long-string)
"unknown")))
+(defun notmuch-database-path ()
+ "Return the database.path value from the notmuch configuration."
+ ;; Trim off the trailing newline
+ (substring (shell-command-to-string
+ (concat notmuch-command " config get database.path"))
+ 0 -1))
+
;;
;; XXX: This should be a generic function in emacs somewhere, not