From: Mark Walters <markwalters1009@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/2] emacs: make elide messages use notmuch-show for omitting messages.
Date: Thu, 23 Feb 2012 21:41:34 +0000 [thread overview]
Message-ID: <1330033294-21980-3-git-send-email-markwalters1009@gmail.com> (raw)
In-Reply-To: <1330033294-21980-1-git-send-email-markwalters1009@gmail.com>
Previously the elide messages code got the entire-thread from
notmuch-show.c and then threw away all non-matching messages. This
version calls notmuch-show.c without the --entire-thread flag so
it never receives the non-matching messages in the first place.
This makes it substantially faster.
---
emacs/notmuch-show.el | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index dcef3d5..e368363 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -981,9 +981,10 @@ current buffer, if possible."
"Insert the message tree TREE at depth DEPTH in the current thread."
(let ((msg (car tree))
(replies (cadr tree)))
- (if (or (not notmuch-show-elide-non-matching-messages)
- (plist-get msg :match))
- (notmuch-show-insert-msg msg depth))
+ ;; We test whether there is a message or just some replies.
+ (if (eq (length tree) 2)
+ (notmuch-show-insert-msg msg depth)
+ (setq replies msg))
(notmuch-show-insert-thread replies (1+ depth))))
(defun notmuch-show-insert-thread (thread depth)
@@ -1064,7 +1065,8 @@ function is used."
(append (list "\'") basic-args
(list "and (" notmuch-show-query-context ")\'"))
(append (list "\'") basic-args (list "\'"))))
- (cli-args (list "--entire-thread")))
+ (cli-args (unless notmuch-show-elide-non-matching-messages
+ (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.
--
1.7.2.3
next prev parent reply other threads:[~2012-02-23 21:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-23 21:41 [PATCH 0/2] Make elide messages use cli side Mark Walters
2012-02-23 21:41 ` [PATCH 1/2] emacs/cli: remove entire-thread default from show: JSON Mark Walters
2012-02-23 21:45 ` Adam Wolfe Gordon
2012-02-23 22:04 ` Mark Walters
2012-02-23 21:41 ` Mark Walters [this message]
-- strict thread matches above, loose matches on Subject: below --
2012-04-10 17:04 [PATCH 0/2] Allow JSON to use non-entire thread, and use for elide Mark Walters
2012-04-10 17:04 ` [PATCH 2/2] emacs: make elide messages use notmuch-show for omitting messages Mark Walters
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://notmuchmail.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1330033294-21980-3-git-send-email-markwalters1009@gmail.com \
--to=markwalters1009@gmail.com \
--cc=notmuch@notmuchmail.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhetil.org/notmuch.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).