--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id E8C04429E5B\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 09:59:32 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id P5fZc6+82z27 for <notmuch@notmuchmail.org>;\r
+ Wed, 1 Feb 2012 09:59:32 -0800 (PST)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 44078429E34\r
+ for <notmuch@notmuchmail.org>; Wed, 1 Feb 2012 09:59:32 -0800 (PST)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1RseSt-0004ge-Dl; Wed, 01 Feb 2012 17:59:27 +0000\r
+Received: from 94-192-233-223.zone6.bethere.co.uk ([94.192.233.223]\r
+ helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1RseSs-00014t-Tw; Wed, 01 Feb 2012 17:59:27 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Austin Clements <amdragon@MIT.EDU>\r
+Subject: Re: [PATCH 3/7] lib: Make notmuch_query_search_messages set the\r
+ exclude flag\r
+In-Reply-To: <20120131162506.GE10898@mit.edu>\r
+References: <8762fu4aqt.fsf@qmul.ac.uk>\r
+ <1327862394-14334-3-git-send-email-markwalters1009@gmail.com>\r
+ <20120131044352.GZ17991@mit.edu> <87y5soccyi.fsf@qmul.ac.uk>\r
+ <20120131162506.GE10898@mit.edu>\r
+User-Agent: Notmuch/0.11+137~gd5f6ffb (http://notmuchmail.org) Emacs/23.2.1\r
+ (i486-pc-linux-gnu)\r
+Date: Wed, 01 Feb 2012 18:00:34 +0000\r
+Message-ID: <87fweusabh.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 94.192.233.223\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 505d91fa1e81c3e5fee6a98be889d8c4 (of first 20000 bytes)\r
+X-SpamAssassin-Score: -1.8\r
+X-SpamAssassin-SpamBar: -\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -1.8 points.\r
+ Summary of the scoring: \r
+ * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/,\r
+ * medium trust\r
+ * [138.37.6.40 listed in list.dnswl.org]\r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.0 T_RP_MATCHES_RCVD Envelope sender domain matches handover relay\r
+ * domain\r
+ * 0.5 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+Cc: notmuch@notmuchmail.org\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 01 Feb 2012 17:59:33 -0000\r
+\r
+On Tue, 31 Jan 2012 11:25:06 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> Quoth Mark Walters on Jan 31 at 11:45 am:\r
+> > On Mon, 30 Jan 2012 23:43:52 -0500, Austin Clements <amdragon@MIT.EDU> wrote:\r
+> > > Quoth Mark Walters on Jan 29 at 6:39 pm:\r
+> > > > notmuch_message_node_t *iterator;\r
+> > > > };\r
+> > > > \r
+> > > > diff --git a/lib/notmuch.h b/lib/notmuch.h\r
+> > > > index 7929fe7..740d005 100644\r
+> > > > --- a/lib/notmuch.h\r
+> > > > +++ b/lib/notmuch.h\r
+> > > > @@ -449,6 +449,11 @@ typedef enum {\r
+> > > > const char *\r
+> > > > notmuch_query_get_query_string (notmuch_query_t *query);\r
+> > > > \r
+> > > > +/* specify whether to results should omit the excluded results rather\r
+> > > > + * than just marking them excluded */\r
+> > > > +void\r
+> > > > +notmuch_query_set_omit_excluded_messages (notmuch_query_t *query, notmuch_bool_t omit);\r
+> > > > +\r
+> > > \r
+> > > I don't think we should add this API. The library behavior will not\r
+> > > change for library users that don't use excludes and library users\r
+> > > that do use excludes should by aware of the excluded flag and do the\r
+> > > appropriate thing.\r
+> > > \r
+> > > I can see why this is handy in some cases, but I don't think it\r
+> > > provides enough utility to warrant becoming part of the permanent and\r
+> > > minimal library interface.\r
+> > \r
+> > This is really a performance improvement: suppose that there are lots of\r
+> > threads that only match in excluded messages. Then without this flag we\r
+> > will spend lots of time constructing the thread only for it to be\r
+> > ignored. (In contrived situations this could be arbitrarily slower.)\r
+> \r
+> I would prefer to keep the public API minimal and only introduce\r
+> something like this if people actually experience performance\r
+> problems.\r
+\r
+I have looked at removing this api and it does make things\r
+inconvenient. It is nice to be able to pass a notmuch_messages_t around\r
+without having to teach every function that takes notmuch_messages_t\r
+(e.g., notmuch_messages_collect_tags) about the exclude flag.\r
+\r
+An alternative might be to make it possible to set an omit excludes flag\r
+on a notmuch_messages_t object but that seems worse than the current\r
+patches.\r
+\r
+Any thoughts?\r
+\r
+Mark\r
+\r
+PS I think my current version fixes all the other queries so I will post\r
+that later today (in a new thread!).\r