[PATCH 4/4] Update NEWS for user.other_name
[notmuch-archives.git] / c2 / b0c931ec3ccbf2cb0863656d52c37720fa1765
1 Return-Path: <m.walters@qmul.ac.uk>\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 9E665429E54\r
6         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 10:46:53 -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: -1.098\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
12         tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
13         NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
14 Received: from olra.theworths.org ([127.0.0.1])\r
15         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
16         with ESMTP id fhymNktiTkJr for <notmuch@notmuchmail.org>;\r
17         Sun, 22 Jan 2012 10:46:53 -0800 (PST)\r
18 Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
19         (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
20         (No client certificate requested)\r
21         by olra.theworths.org (Postfix) with ESMTPS id B7DB6429E40\r
22         for <notmuch@notmuchmail.org>; Sun, 22 Jan 2012 10:46:52 -0800 (PST)\r
23 Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
24         by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
25         (envelope-from <m.walters@qmul.ac.uk>)\r
26         id 1Rp2RD-0005b4-IE; Sun, 22 Jan 2012 18:46:47 +0000\r
27 Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
28         helo=localhost)\r
29         by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
30         (envelope-from <m.walters@qmul.ac.uk>)\r
31         id 1Rp2RD-0004MT-7V; Sun, 22 Jan 2012 18:46:47 +0000\r
32 From: Mark Walters <markwalters1009@gmail.com>\r
33 To: Austin Clements <amdragon@MIT.EDU>\r
34 Subject: Re: [PATCH] Automatically exclude tags in notmuch-show\r
35 In-Reply-To: <20120122181609.GQ16740@mit.edu>\r
36 References: <874nvric7c.fsf@qmul.ac.uk>\r
37         <1327010583-23954-1-git-send-email-markwalters1009@gmail.com>\r
38         <20120119225910.GT16740@mit.edu> <871uqvgrnm.fsf@qmul.ac.uk>\r
39         <20120120171801.GA16740@mit.edu> <20120122181609.GQ16740@mit.edu>\r
40 User-Agent: Notmuch/0.11+77~gad6d0d5 (http://notmuchmail.org) Emacs/23.2.1\r
41         (i486-pc-linux-gnu)\r
42 Date: Sun, 22 Jan 2012 18:47:43 +0000\r
43 Message-ID: <87d3abing0.fsf@qmul.ac.uk>\r
44 MIME-Version: 1.0\r
45 Content-Type: text/plain; charset=us-ascii\r
46 X-Sender-Host-Address: 94.192.233.223\r
47 X-QM-SPAM-Info: Sender has good ham record.  :)\r
48 X-QM-Body-MD5: a39b6fe74443b40cf97eefdc497e27ba (of first 20000 bytes)\r
49 X-SpamAssassin-Score: -1.8\r
50 X-SpamAssassin-SpamBar: -\r
51 X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
52         determine if it is\r
53         spam. We require at least 5.0 points to mark a message as spam.\r
54         This message scored -1.8 points.\r
55         Summary of the scoring: \r
56         * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
57         *      medium trust\r
58         *      [138.37.6.40 listed in list.dnswl.org]\r
59         * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
60         provider *      (markwalters1009[at]gmail.com)\r
61         * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
62         *      domain\r
63         *  0.5 AWL AWL: From: address is in the auto white-list\r
64 X-QM-Scan-Virus: ClamAV says the message is clean\r
65 Cc: notmuch@notmuchmail.org\r
66 X-BeenThere: notmuch@notmuchmail.org\r
67 X-Mailman-Version: 2.1.13\r
68 Precedence: list\r
69 List-Id: "Use and development of the notmuch mail system."\r
70         <notmuch.notmuchmail.org>\r
71 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
72         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
73 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
74 List-Post: <mailto:notmuch@notmuchmail.org>\r
75 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
76 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
77         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
78 X-List-Received-Date: Sun, 22 Jan 2012 18:46:53 -0000\r
79 \r
80 \r
81 On Sun, 22 Jan 2012 13:16:09 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
82 > Quoth myself on Jan 20 at 12:18 pm:\r
83 > > Quoth Mark Walters on Jan 20 at 12:10 am:\r
84 > > > \r
85 > > > Ok Having said this is trivial I have found a problem. What should\r
86 > > > notmuch do if you do something like\r
87 > > > \r
88 > > > notmuch show id:<some-id>\r
89 > > > and that message is marked with a deleted tag? To be consistent with the\r
90 > > > other cases (where a deleted message is in a matched thread) we might\r
91 > > > want to return the message with the not-matched flag set (eg in\r
92 > > > JSON). But my patch doesn't, as it never even sees the thread since it\r
93 > > > doesn't match.\r
94 > > > \r
95 > > > Looking at notmuch-show.c I think we should not apply the exclude tags\r
96 > > > to do_show_single, but usually should apply it to do_show. One solution\r
97 > > > which is simple and is at least close to right would be to get do_show\r
98 > > > to return the number of threads found. If this is zero then retry the\r
99 > > > query without the excludes (possible setting the match_flag to zero on\r
100 > > > each message since we know it does not match)\r
101 > > > \r
102 > > > This is not a completely correct solution as if you ask notmuch-show to\r
103 > > > show more than one thread it might  threads which only contain deleted\r
104 > > > messages.\r
105 > > > \r
106 > > > I can't see other good possibilities without slowing down the normal\r
107 > > > path a lot (eg find all threads that match the original query and then\r
108 > > > apply the argument above).\r
109 > > > \r
110 > > > Any thoughts?\r
111 > > \r
112 > > Oh dear.\r
113 > > \r
114 > > Well, here's one idea.  Instead of doing a single thread query in\r
115 > > show, do a thread query without the exclusions and then a message\r
116 > > query with the exclusions.  Output all of the messages from the first\r
117 > > query, but use the results of the second query to determine which\r
118 > > messages are "matched".  The same could be accomplished in the library\r
119 > > somewhat more efficiently, but it's not obvious to me what the API\r
120 > > would be.\r
121\r
122 > Here's a slightly crazier idea that's more library-invasive than the\r
123 > original approach, but probably better in the long run.\r
124\r
125 > Have notmuch_query_search_* return everything and make exclusion a\r
126 > message flag like NOTMUCH_MESSAGE_FLAG_MATCH.  Tweak the definition of\r
127 > "matched" to mean "matched and not excluded" (specifically, a message\r
128 > would have the match flag or the excluded flag or neither, but not\r
129 > both).  Search would skip threads with zero matched messages and I\r
130 > think show would Just Work.\r
131\r
132 > I can think of two ways to implement this.  notmuch_query_search_*\r
133 > could perform both the original query and the query with exclusions\r
134 > and use the docid set from the second to compute the "excluded"\r
135 > message flag.  Alternatively, it could examine the tags of each\r
136 > message directly to compute the flag.  The latter is probably easier\r
137 > to implement, but probably slower.\r
138 \r
139 I really like the idea of returning two flags. I think your first\r
140 suggestion works better for sorting reasons: we want to return a thread\r
141 which has a match-not-excluded message and also a match-excluded message\r
142 to be sorted based on the match-not-excluded message. Hence in\r
143 notmuch_query_search_threads we can create the list of docids to iterate\r
144 over as the list generated by query with exclusions followed by the list\r
145 without exclusions.  This list contains lots of messages twice but that\r
146 doesn't matter since we have to check whether we have already output\r
147 the message in an earlier thread anyway. \r
148 \r
149 Incidentally, it might not take very much more code to allow\r
150 notmuch_query_search_threads to take two arbitrary queries and return\r
151 all threads which match the first case but mark as matched those that\r
152 match the second: i.e. a step on the way towards "thread based and".\r
153 \r
154 Best wishes\r
155 \r
156 Mark\r
157 \r
158 \r