Add an extra parameter to notmuch-query-get-threads (in
notmuch-query.el) so that callers can pass in extra parameters to
control the sort order, the --headers-only option, and threading etc.
---
 emacs/notmuch-query.el |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/emacs/notmuch-query.el b/emacs/notmuch-query.el
index d66baea..b3c91a3 100644
--- a/emacs/notmuch-query.el
+++ b/emacs/notmuch-query.el
@@ -22,7 +22,7 @@
 (require 'notmuch-lib)
 (require 'json)

-(defun notmuch-query-get-threads (search-terms)
+(defun notmuch-query-get-threads (search-terms &rest extra-format)
   "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
@@ -33,6 +33,8 @@ is a possibly empty forest of replies.
         (json-object-type 'plist)
         (json-array-type 'list)
         (json-false 'nil))
+    (if extra-format
+       (setq args (append args extra-format)))
     (if notmuch-show-process-crypto
        (setq args (append args '("--decrypt"))))
     (setq args (append args search-terms))
-- 
1.7.2.3

Reply via email to