From: Mark Walters Date: Tue, 29 May 2012 08:37:27 +0000 (+0100) Subject: Re: search summary and exclusions X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=bf3827564ff42a18bdcc894018d93955afe46f0a;p=notmuch-archives.git Re: search summary and exclusions --- diff --git a/b8/0b477f048c94f84a96e0747da200f69e28355c b/b8/0b477f048c94f84a96e0747da200f69e28355c new file mode 100644 index 000000000..af1ce8a10 --- /dev/null +++ b/b8/0b477f048c94f84a96e0747da200f69e28355c @@ -0,0 +1,138 @@ +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 8A794431FBC + for ; Tue, 29 May 2012 01:37:31 -0700 (PDT) +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 H3pwLgA7tjDb for ; + Tue, 29 May 2012 01:37:31 -0700 (PDT) +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 B71B6431FAF + for ; Tue, 29 May 2012 01:37:30 -0700 (PDT) +Received: from smtp.qmul.ac.uk ([138.37.6.40]) + by mail2.qmul.ac.uk with esmtp (Exim 4.71) + (envelope-from ) + id 1SZHvi-00005E-Gv; Tue, 29 May 2012 09:37:27 +0100 +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 1SZHvh-00057q-Rp; Tue, 29 May 2012 09:37:26 +0100 +From: Mark Walters +To: Peter Wang , notmuch@notmuchmail.org +Subject: Re: search summary and exclusions +In-Reply-To: <20120529140107.GE2347@hili.localdomain> +References: <20120529000012.GF2331@hili.localdomain> + <87mx4sp79z.fsf@servo.finestructure.net> + <20120529140107.GE2347@hili.localdomain> +User-Agent: Notmuch/0.13+55~g992aa73 (http://notmuchmail.org) Emacs/23.3.1 + (x86_64-pc-linux-gnu) +Date: Tue, 29 May 2012 09:37:27 +0100 +Message-ID: <87likbmlh4.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: 91af1b5b7934ad7415a8e7c79e37dbb9 (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 +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: Tue, 29 May 2012 08:37:31 -0000 + + +Hi +On Tue, 29 May 2012, Peter Wang wrote: +> On Mon, 28 May 2012 10:03:35 -0700, Jameson Graef Rollins wrote: +>> On Mon, May 28 2012, Peter Wang wrote: +>> > Exclusions don't work the way I expected with the search command and +>> > --output=summary. I would like messages with excluded tags to be +>> > treated as if they don't exist at all, but currently: +>> > +>> > * excluded messages are counted towards the "total" +>> > * excluded tags are included in the "tags" set +>> > +>> > Are these deliberate? Especially the second point seems to conflict +>> > with search --output=tags, which doesn't show excluded tags. +>> +>> Hi, Peter. Can you explain more what you mean? I'm not sure what your +>> two bullets have to do with --output=summary. Messages are counted with +>> the count subcommand, and tags are shown with search --output=tags, +>> neither of which have anything to do with --output=summary, and both of +>> which accept the exclude flag: +>> +>> notmuch count --exclude=true '*' +>> notmuch search --output=tags --exclude=true '*' +>> +>> Maybe you can give a clearer explanation of what your issue is. +>> Examples help. +> +> Sure. I keep draft messages in the mail store, and tag them with +> 'draft', and later 'deleted'. I would like the exclusions to treat +> draft and deleted messages as if they didn't exist in the store. +> +> % ./notmuch search --format=json --exclude=true -- thread:0000000000009598 tag:unread +> [{"thread": "0000000000009598", +> "timestamp": 1338231998, +> "date_relative": "Today 05:06", +> "matched": 1, +> "total": 15, +> "authors": "Mark Walters| Peter Wang", +> "subject": "[PATCH v6 3/6] cli: make --entire-thread=false work for format=json.", +> "tags": ["deleted", "draft", "replied", "sent", "unread"]}] +> +> Here is a thread I participated in. From this, my MUA displays "1/15", +> suggesting that there is 1 unread message out of a total of 15. But +> upon opening the thread, there are only 11 messages visible: 4 were +> drafts (possibly deleted) which have been excluded. To the user, it +> looks like some messages went missing. +> +> Therefore I would like search --output=summary --exclude=true +> to report the total number of non-excluded messages. It doesn't need to +> be via the "total" field; a new field would be fine. + +It is easy to add this to the JSON format but adding it to the text +format would probably break things, and I would prefer not to have the +formats diverge. + +Does anyone have any suggestions? Would people happy with a change in the +text summary output? + +Best wishes + +Mark