[PATCH v1 1/3] emacs: Allow query to exclude the entire thread and body.

Subject: [PATCH v1 1/3] emacs: Allow query to exclude the entire thread and body.

Date: Fri, 5 Sep 2014 13:59:27 +0100

To: notmuch@notmuchmail.org

Cc:

From: David Edmondson


Callers to `notmuch-query-get-threads' can optionally choose not to
receive either the entire thread and/or the body of messages.

This is intended to reduce the amount of output in cases where one or
both of these items is not useful.
---
 emacs/notmuch-query.el | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index d1daffc..f83ca9b 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -21,7 +21,8 @@
 
 (require 'notmuch-lib)
 
-(defun notmuch-query-get-threads (search-terms)
+(defun notmuch-query-get-threads (search-terms &optional exclude-entire-thread
+					       exclude-body)
   "Return a list of threads of messages matching SEARCH-TERMS.
 
 A thread is a forest or list of trees. A tree is a two element
@@ -31,6 +32,10 @@ is a possibly empty forest of replies.
   (let ((args '("show" "--format=sexp" "--format-version=1")))
     (if notmuch-show-process-crypto
 	(setq args (append args '("--decrypt"))))
+    (if exclude-entire-thread
+	(setq args (append args '("--entire-thread=false"))))
+    (if exclude-body
+	(setq args (append args '("--body=false"))))
     (setq args (append args search-terms))
     (apply #'notmuch-call-notmuch-sexp args)))
 
-- 
1.8.5.2 (Apple Git-48)


Thread: