Re: thread merge/split proposal
[notmuch-archives.git] / 81 / 58434e34264dedd8cc881e0ecb752762abb190
1 Return-Path: <david@tethera.net>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 15750431FCF\r
6         for <notmuch@notmuchmail.org>; Sun,  7 Dec 2014 09:41:33 -0800 (PST)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: 0\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\r
12         autolearn=disabled\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id Clc6iL82YTgL for <notmuch@notmuchmail.org>;\r
16         Sun,  7 Dec 2014 09:41:29 -0800 (PST)\r
17 Received: from yantan.tethera.net (yantan.tethera.net [199.188.72.155])\r
18         (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits))\r
19         (No client certificate requested)\r
20         by olra.theworths.org (Postfix) with ESMTPS id 71A31431FC0\r
21         for <notmuch@notmuchmail.org>; Sun,  7 Dec 2014 09:41:29 -0800 (PST)\r
22 Received: from remotemail by yantan.tethera.net with local (Exim 4.80)\r
23         (envelope-from <david@tethera.net>)\r
24         id 1Xxfpi-00032K-JV; Sun, 07 Dec 2014 13:41:22 -0400\r
25 Received: (nullmailer pid 2029 invoked by uid 1000); Sun, 07 Dec 2014\r
26         17:41:17 -0000\r
27 From: David Bremner <david@tethera.net>\r
28 To: notmuch@notmuchmail.org\r
29 Subject: Re: notmuch_query_add_tag_excluded and notmuch_query_search_threads\r
30 In-Reply-To: <1417962498-astroid-0-zqj7j2s0ov-9575@strange>\r
31 References: <1417905319-astroid-0-i86er7iwg5-10728@strange>\r
32         <87388rfzhw.fsf@maritornes.cs.unb.ca>\r
33         <1417958519-astroid-0-ydniq6pte2-8575@strange>\r
34         <87wq63ef9s.fsf@maritornes.cs.unb.ca>\r
35         <1417962498-astroid-0-zqj7j2s0ov-9575@strange>\r
36 User-Agent: Notmuch/0.19+2~g32855b9 (http://notmuchmail.org) Emacs/24.4.1\r
37         (x86_64-pc-linux-gnu)\r
38 Date: Sun, 07 Dec 2014 18:41:17 +0100\r
39 Message-ID: <87r3wbe4si.fsf@maritornes.cs.unb.ca>\r
40 MIME-Version: 1.0\r
41 Content-Type: text/plain; charset=utf-8\r
42 Content-Transfer-Encoding: quoted-printable\r
43 X-BeenThere: notmuch@notmuchmail.org\r
44 X-Mailman-Version: 2.1.13\r
45 Precedence: list\r
46 List-Id: "Use and development of the notmuch mail system."\r
47         <notmuch.notmuchmail.org>\r
48 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
49         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
50 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
51 List-Post: <mailto:notmuch@notmuchmail.org>\r
52 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
53 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
54         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
55 X-List-Received-Date: Sun, 07 Dec 2014 17:41:33 -0000\r
56 \r
57 Gaute Hope <eg@gaute.vetsj.com> writes:\r
58 >>=20\r
59 >\r
60 > Ok, that explains it. You are right - I mixed up, the count is correct.\r
61 >\r
62 > regards, gaute\r
63 \r
64 At the end of this message is a simpler example, that I think\r
65 demonstrates a bug. At the very list it's not very nice that the\r
66 destructiveness only shows up when excludes are involved.\r
67 \r
68 Here is the output; note the second exclude query!\r
69 \r
70 ,----\r
71 | =E2=95=AD=E2=94=80 maritornes:~/tmp=20\r
72 | =E2=95=B0=E2=94=80% NOTMUCH_DEBUG_QUERY=3D1 ./a.out\r
73 | Query string is:\r
74 | tag:muted\r
75 | Exclude query is:\r
76 | Xapian::Query()\r
77 | Final query is:\r
78 | Xapian::Query((Tmail AND 0 * Kmuted))\r
79 | ret1=3D84\r
80 | Exclude query is:\r
81 | Xapian::Query(<alldocuments>)\r
82 | Final query is:\r
83 | Xapian::Query(((Tmail AND 0 * Kmuted) AND_NOT <alldocuments>))\r
84 | ret2=3D0\r
85 `----\r
86 \r
87 \r
88 \r
89 #include <notmuch.h>\r
90 #include <stdlib.h>\r
91 #include <stdio.h>\r
92 \r
93 int main(int argc, char **argv){\r
94 \r
95   notmuch_database_t *nm_db;\r
96   notmuch_query_t *query;\r
97 \r
98   if (notmuch_database_open ("/home/bremner/Maildir/",\r
99                              NOTMUCH_DATABASE_MODE_READ_ONLY, &nm_db))\r
100     return 1;\r
101 \r
102   query =3D notmuch_query_create (nm_db, "tag:muted");\r
103   notmuch_query_add_tag_exclude (query, "muted");\r
104   notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_TRUE);\r
105 \r
106   printf("ret1=3D%d\n", notmuch_query_count_threads (query));\r
107   printf("ret2=3D%d\n", notmuch_query_count_threads (query));\r
108 \r
109 }\r