[PATCH 4/4] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag

Mark Walters markwalters1009 at gmail.com
Mon Jan 23 17:18:43 PST 2012


Make notmuch-search.c respect the NOTMUCH_MESSAGE_FLAG_EXCLUDED.  All tests
should pass: i.e., the behaviour should be the same as before the
series.

---
 notmuch-search.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/notmuch-search.c b/notmuch-search.c
index 8867aab..b005abf 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -227,7 +227,7 @@ do_search_threads (const search_format_t *format,
 
 	thread = notmuch_threads_get (threads);
 
-	if (i < offset) {
+	if ((i < offset) || (notmuch_thread_get_matched_messages (thread) == 0)) {
 	    notmuch_thread_destroy (thread);
 	    continue;
 	}
@@ -318,6 +318,9 @@ do_search_messages (const search_format_t *format,
 
 	message = notmuch_messages_get (messages);
 
+	if (notmuch_message_get_flag (message, NOTMUCH_MESSAGE_FLAG_EXCLUDED))
+	    continue;
+
 	if (output == OUTPUT_FILES) {
 	    filenames = notmuch_message_get_filenames (message);
 
-- 
1.7.2.3



More information about the notmuch mailing list