notmuch_query_add_tag_excluded and notmuch_query_search_threads

Gaute Hope eg at gaute.vetsj.com
Sun Dec 7 05:24:32 PST 2014


Excerpts from David Bremner's message of December 7, 2014 12:52:
> Gaute Hope <eg at gaute.vetsj.com> writes:
> 
>>
>> I would expect to have the thread matching, I get nothing however. It
>> does show up in: $ notmuch search tag:muted (muted added to excluded
>> tags), but does notmuch search operate with
>> notmuch_query_search_messages? 
>>
> 
> I expanded your sample into a full program, and it seems to work ok for
> me. Not sure what the difference might be.
> 
> [...]
>   query = notmuch_query_create (nm_db, "tag:muted");
>   notmuch_query_add_tag_exclude (query, "muted");
>   notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_TRUE);

  printf("%d\n", notmuch_query_count_threads (query));

> 
>   for (threads = notmuch_query_search_threads (query);
>        notmuch_threads_valid (threads);
>        notmuch_threads_move_to_next (threads))
> 
> [...]

Thanks,

I also did an notmuch_query_count_threads (query) as illustrated
above, this returns 0 and also results in the erroneous behavior below. Your code works as expected without the _count_threads() call.

regards, gaute



More information about the notmuch mailing list