From: Mark Walters Date: Sat, 3 Mar 2012 12:41:42 +0000 (+0000) Subject: Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=9682e8ec57edd70d7f180f8a2ef927860c7d6b72;p=notmuch-archives.git Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag --- diff --git a/a6/69ade360727db49ee3f02f70c6f34ab9494b53 b/a6/69ade360727db49ee3f02f70c6f34ab9494b53 new file mode 100644 index 000000000..04322ecca --- /dev/null +++ b/a6/69ade360727db49ee3f02f70c6f34ab9494b53 @@ -0,0 +1,180 @@ +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 25EDE431FAF + for ; Sat, 3 Mar 2012 04:39:59 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 1.401 +X-Spam-Level: * +X-Spam-Status: No, score=1.401 tagged_above=-999 required=5 + tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, + FREEMAIL_REPLY=2.499, 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 Xod9GvBaIz2t for ; + Sat, 3 Mar 2012 04:39:58 -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 4A66E431FAE + for ; Sat, 3 Mar 2012 04:39:58 -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 1S3oFe-0005Ck-7C; Sat, 03 Mar 2012 12:39:54 +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 1S3oFd-0004Lo-Qz; Sat, 03 Mar 2012 12:39:54 +0000 +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag +In-Reply-To: <87y5riuz7v.fsf@qmul.ac.uk> +References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> + <87y5riuz7v.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.11.1+280~gd0c6aaf (http://notmuchmail.org) Emacs/23.2.1 + (i486-pc-linux-gnu) +Date: Sat, 03 Mar 2012 12:41:42 +0000 +Message-ID: <87d38t26wp.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: a070a8689744ef5bb3ebd48998d3b117 (of first 20000 bytes) +X-SpamAssassin-Score: -1.2 +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.2 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 + * 1.0 FREEMAIL_REPLY From and body contain different freemails + * 0.1 AWL AWL: From: address is in the auto white-list +X-QM-Scan-Virus: ClamAV says the message is clean +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: Sat, 03 Mar 2012 12:39:59 -0000 + +On Sat, 03 Mar 2012 03:42:44 +0000, Mark Walters wrote: +> On Thu, 1 Mar 2012 22:30:32 +0000, Mark Walters wrote: +> > This is essentially the same as +> > id:"1330157204-26094-1-git-send-email-markwalters1009@gmail.com" but +> > has been rebased against master. The changes are to patch 12/13 for +> > notmuch-show.el (which was posted as a followup to the previous series) +> > and to the tests (patch 9/13) which changed in Austin's JSON show +> > rewrite. +> +> There are some problems with this series which were discussed on irc +> today. In particular the cli notmuch search output is too cluttered for +> human readability (with lots of excluded threads showing [0/n]) and in +> some cases it is too slow (it is the same speed as if there were no +> excludes but looks slower as it outputs less). The following is a +> proposal to address this. + +I have thought some more about this and this does seem the correct way +to go. I have implemented this and will post it as a patch series +shortly. + +The original series essentially distinguished between show +everything and mark excluded (default) and show everything not marking +excluded (with the --no-exclude option). These two options are very +similar and do not include the option of just throwing away the excluded +messages. + +This proposal makes the two options roughly "return only non-excluded +messages" (the default) and return all messages marking the excluded +ones (with a new option --with-excluded which replace the --no-exclude +option). + +The exact behaviour is a little more subtle but that is essentially it +(as detailed in the parent message). + +> PROPOSAL +> +> lib: Change the notmuch_query_set_omit_excluded_messages to a +> notmuch_query_set_with_excluded_messages option (essentially the +> negation) This just affects the `seeding' of the thread search: whole +> threads are returned regardless but unless this is set only threads that +> match in a non-excluded message are returned. In either case excluded +> messages have the exclude flag set. +> +> cli: replace the --no-excludes option with a --with-excluded option +> which is roughly the *same*: it outputs the excluded messages (but marks +> them excluded in so far as the output allows it). I deal with each of +> count/search and show in turn. +> +> count: apply excludes unless --with-excluded. This includes the excluded +> messages/threads in the count. This could be done with the lib call +> above but it is easier not to set the excludes in the first place. +> +> search: for output=threads|messages|tags we either set or not the +> exclude terms depending on the --with-excluded option. +> +> For output=summary (default) we normally return just those threads which +> match in a non-excluded message. With the --with-excluded option return +> all threads that match (using the with_excluded lib call). In both cases +> the count is [x/y] where x is the number of matching non-excluded +> messages and y is the total number of messages. It will not be possible +> to get the pre-exclude output; with the --with-excluded option you get +> the same threads but the count (x in the above) will show matched and +> non-excluded instead of matched. +> +> show: raw/part are irrelevant as they do not (and should not) apply +> excludes. +> +> When given --with-excluded it returns all messages (in all threads if +> given --entire-thread) and marks excluded if possible (i.e., unless +> format=mbox). +> +> The remaining cases are all when --with-excluded is not passed. We can +> have format=json/text/mbox and entire-thread or not. We do not pass +> with_excluded to the lib so we only get threads matching in a +> non-excluded message. The question is which of the messages in these +> threads to output. Note emacs will not care as it will pass in the +> --with-excluded option. +> +> Perhaps --entire-thread should return the whole thread including +> excluded messages but without --entire-thread just return the +> matching-non-excluded messages. We have flexibility here as show did not +> do anything with exclude_tags until this series so not even git users +> will have got used to any particular behaviour. + +I have followed this behaviour as it does seem the logical one. If the +user asks for entire-thread it would seem odd to omit some messages from +it (and if passing it to some other program the missing messages could +inhibit reconstruction of the thread). When it is not entire-thread it +would be weird to return all matched messages (including the excluded +ones) in threads with a matched non-excluded message but not +matched-excluded messages in threads which only contain matched-excluded +messages. + +As an example of a use for the former is an emacs frontend showing +threaded messages (eg notmuch-pick): it would want all the messages in +the threads it gets (or it will mess up the threading) but probably does +not want threads that only match in excluded messages. + +Best wishes + +Mark +