Re: [Patch v7 00/13] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag
authorMark Walters <markwalters1009@gmail.com>
Sat, 3 Mar 2012 12:41:42 +0000 (12:41 +0000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:45:12 +0000 (09:45 -0800)
a6/69ade360727db49ee3f02f70c6f34ab9494b53 [new file with mode: 0644]

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