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 C8CFE431FAE for ; Thu, 2 Feb 2012 09:38:21 -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 Rg+qi13jTiZY for ; Thu, 2 Feb 2012 09:38:21 -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 DDD19431FC3 for ; Thu, 2 Feb 2012 09:38:20 -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 1Rt0bu-0006Ns-79; Thu, 02 Feb 2012 17:38:15 +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 1Rt0bt-0003Ey-Vj; Thu, 02 Feb 2012 17:38:14 +0000 From: Mark Walters To: notmuch@notmuchmail.org, Austin Clements Subject: [Patch V4] Add NOTMUCH_MESSAGE_FLAG_EXCLUDED flag User-Agent: Notmuch/0.11+140~gb5e1cf0 (http://notmuchmail.org) Emacs/23.2.1 (i486-pc-linux-gnu) Date: Thu, 02 Feb 2012 17:39:22 +0000 Message-ID: <874nv9rv79.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: cd18d7160eb5031e5c41a2add3c63924 (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: Thu, 02 Feb 2012 17:38:22 -0000 Here is the latest version of this patch set. I think I have fixed most of the problems raised in review but there are some remaining issues detailed below. Changes and queries: 1) Changed --do-not-exclude option to --no-exclude 2) The api notmuch_query_set_omit_excluded_messages remains: without it I can't see how a user can pass the notmuch_messages_t object around which does not contain the excluded messages. See id:"87fweusabh.fsf@qmul.ac.uk" 3) I have introduced a new function notmuch_thread_get_flag_messages (notmuch_thread_t *thread, unsigned int flag_mask, unsigned int flags) which returns the number of messages with the specified flags on flag_mask. (Note the current NOTMUCH_MESSAGE_FLAGs were nominally the bit position of the flag rather than the actual bit of the flag. I changed that. I am not completely happy with the style for this commit (patch 7/11): any comments gratefully received! 4) In id:"20120131044352.GZ17991@mit.edu" Austin suggested that I use a notmuch_mset_messages_t object rather than an notmuch_doc_id_set_t. I couldn't see how that would work unless the iterator would generate the excludes in step with the main query. At the moment the doc_id object just stores a bitmap listing all relevant excluded messages. 5) If we have a query which overrides the excludes such as "blah and tag:deleted" should the tag:deleted messages still be marked excluded? The current implementation does mark them excluded but my preference would be not to. What do people think? 6) In id:"20120131050748.GA10844@mit.edu" Austin pointed out that the sort will be influenced by the excluded messages. I do not think either of us are sure whether it should be or not so I have left it as is for the moment. Best wishes Mark