aboutsummaryrefslogtreecommitdiffhomepage
path: root/notmuch-search.c
diff options
context:
space:
mode:
authorGravatar Mark Walters <markwalters1009@gmail.com>2012-03-01 22:30:43 +0000
committerGravatar David Bremner <bremner@debian.org>2012-03-02 08:37:32 -0400
commit7a1beb9e7c7fdf8971a60d810ae24e58c2d09673 (patch)
tree1870498180b61ce2bc26142e4d264f8db0ee7219 /notmuch-search.c
parent99c318cae464159ca5b4ec86643ccf3c8b98c1b3 (diff)
cli: omit excluded messages in results where appropriate.
In all cases of notmuch count/search/show where the results returned cannot reflect the exclude flag return just the matched not-excluded results. If the caller wishes to have all the matched results (i.e., including the excluded ones) they should call with the --no-exclude option. The relevant cases are count: both threads and messages search: all cases except the summary view show: mbox format
Diffstat (limited to 'notmuch-search.c')
-rw-r--r--notmuch-search.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/notmuch-search.c b/notmuch-search.c
index 6d6c0e60..f6061e4e 100644
--- a/notmuch-search.c
+++ b/notmuch-search.c
@@ -210,6 +210,9 @@ do_search_threads (const search_format_t *format,
int first_thread = 1;
int i;
+ if (output == OUTPUT_THREADS)
+ notmuch_query_set_omit_excluded_messages (query, TRUE);
+
if (offset < 0) {
offset += notmuch_query_count_threads (query);
if (offset < 0)
@@ -300,6 +303,8 @@ do_search_messages (const search_format_t *format,
int first_message = 1;
int i;
+ notmuch_query_set_omit_excluded_messages (query, TRUE);
+
if (offset < 0) {
offset += notmuch_query_count_messages (query);
if (offset < 0)
@@ -371,6 +376,10 @@ do_search_tags (notmuch_database_t *notmuch,
const char *tag;
int first_tag = 1;
+ notmuch_query_set_omit_excluded_messages (query, TRUE);
+ /* should the following only special case if no excluded terms
+ * specified? */
+
/* Special-case query of "*" for better performance. */
if (strcmp (notmuch_query_get_query_string (query), "*") == 0) {
tags = notmuch_database_get_all_tags (notmuch);