X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=emacs%2Fnotmuch-lib.el;h=84ba8c5e56de2aa151682bea74e30a4f3808b2e3;hb=b3d466bf397a6f8d70bb50d6fa22c58e3d44badf;hp=1e631d0eb0147a19da00bed2f8af6dbd3dff1dcf;hpb=fd46fc1977e3b0712c07cc4610edee2d91ec5ee0;p=notmuch diff --git a/emacs/notmuch-lib.el b/emacs/notmuch-lib.el index 1e631d0e..84ba8c5e 100644 --- a/emacs/notmuch-lib.el +++ b/emacs/notmuch-lib.el @@ -1029,6 +1029,20 @@ status." (defvar-local notmuch-show-process-crypto nil) +(defun notmuch--run-show (search-terms &optional duplicate) + "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 +list where the first element is a message, and the second element +is a possibly empty forest of replies." + (let ((args '("show" "--format=sexp" "--format-version=5"))) + (when notmuch-show-process-crypto + (setq args (append args '("--decrypt=true")))) + (when duplicate + (setq args (append args (list (format "--duplicate=%d" duplicate))))) + (setq args (append args search-terms)) + (apply #'notmuch-call-notmuch-sexp args))) + ;;; Generic Utilities (defun notmuch-interactive-region ()