From 8658c4f96dd0980b18235202a5775fad44513bdc Mon Sep 17 00:00:00 2001 From: Gaute Hope Date: Sun, 7 Dec 2014 13:24:32 +0000 Subject: [PATCH] Re: notmuch_query_add_tag_excluded and notmuch_query_search_threads --- 05/3fd3e3352be3f732033d7708c1685f3fce17d6 | 106 ++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 05/3fd3e3352be3f732033d7708c1685f3fce17d6 diff --git a/05/3fd3e3352be3f732033d7708c1685f3fce17d6 b/05/3fd3e3352be3f732033d7708c1685f3fce17d6 new file mode 100644 index 000000000..2a299a29d --- /dev/null +++ b/05/3fd3e3352be3f732033d7708c1685f3fce17d6 @@ -0,0 +1,106 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 2051A431FC7 + for ; Sun, 7 Dec 2014 05:23:58 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id y+tYP8VUrHpP for ; + Sun, 7 Dec 2014 05:23:54 -0800 (PST) +Received: from mail-wg0-f53.google.com (mail-wg0-f53.google.com + [74.125.82.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + D62B9431FC0 for ; Sun, 7 Dec 2014 05:23:53 -0800 + (PST) +Received: by mail-wg0-f53.google.com with SMTP id l18so4314593wgh.12 + for ; Sun, 07 Dec 2014 05:23:52 -0800 (PST) +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=1e100.net; s=20130820; + h=x-gm-message-state:date:from:subject:to:references:in-reply-to + :user-agent:message-id:mime-version:content-type + :content-transfer-encoding; + bh=B00qyWF0yqa0b4H6F/DfrvmkTcL0VZLYBOzVUrOxzTw=; + b=AKzG1emUxThrrXvkj9+c5Me4jA9rr59wfSlN0QgazPxnGS6/WQmxzT8Oc8w0j/dLPf + 26gEkVrotqfaU62NOX6i8a94PR8afeJW/pWGRibcaRSL41X2PUYA6QRaeRMdNM9BxjV5 + JNI0E819SbedIL7V5Jy4eDU0XJxQTiufw1ABqXsJX5aAsnMh6cL/gP1w0NGipy2X6gLn + ehcd2R4IuSNVESmLoI4ulcNCKi3Wp1WltWIFfnbOKsMdorstgb+3sC5WrQY4tbnf2M3v + /yR/7lgGGlP3DkBH3lMg7UPArDHdU68TKxOxHLkbFXYlPE1qenE9SFU6VQuF4GNA6bms + lqiw== +X-Gm-Message-State: + ALoCoQmEXCGkZCgf4TuLB1IsEd6rl2LjZx6YMMD98Da7XXCp6PlTGCQ7HsfjrjdNhz/XxEV5i5zn +X-Received: by 10.180.98.138 with SMTP id ei10mr17583394wib.32.1417958632562; + Sun, 07 Dec 2014 05:23:52 -0800 (PST) +Received: from localhost (216.89-20-249.enivest.net. [89.20.249.216]) + by mx.google.com with ESMTPSA id + xt9sm20062035wjc.42.2014.12.07.05.23.51 for + (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); + Sun, 07 Dec 2014 05:23:51 -0800 (PST) +Date: Sun, 07 Dec 2014 13:24:32 +0000 +From: Gaute Hope +Subject: Re: notmuch_query_add_tag_excluded and notmuch_query_search_threads +To: David Bremner , notmuch@notmuchmail.org +References: <1417905319-astroid-0-i86er7iwg5-10728@strange> + <87388rfzhw.fsf@maritornes.cs.unb.ca> +In-Reply-To: <87388rfzhw.fsf@maritornes.cs.unb.ca> +User-Agent: astroid/vv0.1-10-g39dd8180 (https://github.com/gauteh/astroid) +Message-Id: <1417958519-astroid-0-ydniq6pte2-8575@strange> +MIME-Version: 1.0 +Content-Type: text/plain; charset=utf-8; format=flowed +Content-Transfer-Encoding: quoted-printable +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sun, 07 Dec 2014 13:23:58 -0000 + +Excerpts from David Bremner's message of December 7, 2014 12:52: +> Gaute Hope writes: +>=20 +>> +>> 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?=20 +>> +>=20 +> I expanded your sample into a full program, and it seems to work ok for +> me. Not sure what the difference might be. +>=20 +> [...] +> query =3D 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)); + +>=20 +> for (threads =3D notmuch_query_search_threads (query); +> notmuch_threads_valid (threads); +> notmuch_threads_move_to_next (threads)) +>=20 +> [...] + +Thanks, + +I also did an notmuch_query_count_threads (query) as illustrated +above, this returns 0 and also results in the erroneous behavior below. You= +r code works as expected without the _count_threads() call. + +regards, gaute + += -- 2.26.2