From be22d9ebd1070e340c8df1880c55c1f2d2119fb1 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 3 Mar 2012 03:42:44 +0000 Subject: [PATCH] Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag --- 2c/1452fa53c632b8a4299fb21c8bc7f15eabf36e | 150 ++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 2c/1452fa53c632b8a4299fb21c8bc7f15eabf36e diff --git a/2c/1452fa53c632b8a4299fb21c8bc7f15eabf36e b/2c/1452fa53c632b8a4299fb21c8bc7f15eabf36e new file mode 100644 index 000000000..fb92fb852 --- /dev/null +++ b/2c/1452fa53c632b8a4299fb21c8bc7f15eabf36e @@ -0,0 +1,150 @@ +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 C027C431FAF + for ; Fri, 2 Mar 2012 19:41:01 -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 0t-YTJQLf8-G for ; + Fri, 2 Mar 2012 19:40:59 -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 A90CD431FAE + for ; Fri, 2 Mar 2012 19:40:59 -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 1S3fq3-0003qx-RI; Sat, 03 Mar 2012 03:40:56 +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 1S3fq3-0004gc-GU; Sat, 03 Mar 2012 03:40:55 +0000 +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag +In-Reply-To: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> +References: <1330641045-27416-1-git-send-email-markwalters1009@gmail.com> +User-Agent: Notmuch/0.11.1+277~gb0f05ff (http://notmuchmail.org) Emacs/23.2.1 + (i486-pc-linux-gnu) +Date: Sat, 03 Mar 2012 03:42:44 +0000 +Message-ID: <87y5riuz7v.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: 7417e2e565252e3ecd8112db2c0496fd (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 03:41:01 -0000 + +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. + +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. + +Does this seem reasonable? The only potential problem I can see is +someone wanting exactly the pre-exclude search output. Oh and someone +might suggest a better name than --with-excluded: --include-excluded +seemed worse! + +Best wishes + +Mark -- 2.26.2