Previously notmuch-show.c defaulted to --entire-thread when
format=json.  Make the default just the matching messages, but make
the single emacs caller add --entire-thread to the arguments supplied
so the end result should be unchanged.
---
 emacs/notmuch-show.el |    7 ++++---
 notmuch-show.c        |    1 -
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index aa9ccee..dcef3d5 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -1063,14 +1063,15 @@ function is used."
             (args (if notmuch-show-query-context
                       (append (list "\'") basic-args
                               (list "and (" notmuch-show-query-context ")\'"))
-                    (append (list "\'") basic-args (list "\'")))))
-       (notmuch-show-insert-forest (notmuch-query-get-threads args))
+                    (append (list "\'") basic-args (list "\'"))))
+            (cli-args (list "--entire-thread")))
+       (notmuch-show-insert-forest (notmuch-query-get-threads (append cli-args 
args)))
        ;; If the query context reduced the results to nothing, run
        ;; the basic query.
        (when (and (eq (buffer-size) 0)
                   notmuch-show-query-context)
          (notmuch-show-insert-forest
-          (notmuch-query-get-threads basic-args))))
+          (notmuch-query-get-threads (append cli-args basic-args)))))

       (jit-lock-register #'notmuch-show-buttonise-links)

diff --git a/notmuch-show.c b/notmuch-show.c
index d930f94..5a9db8f 100644
--- a/notmuch-show.c
+++ b/notmuch-show.c
@@ -1066,7 +1066,6 @@ notmuch_show_command (void *ctx, unused (int argc), 
unused (char *argv[]))
     switch (format_sel) {
     case NOTMUCH_FORMAT_JSON:
        format = &format_json;
-       params.entire_thread = TRUE;
        break;
     case NOTMUCH_FORMAT_TEXT:
        format = &format_text;
-- 
1.7.2.3

Reply via email to