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