From 300307fa67e8e459ad2349f4984cdaa19c9d6cfa Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sun, 25 Nov 2012 14:31:53 +0000 Subject: [PATCH] Re: [PATCH 0/6] API for iterating over all messages in a thread --- d3/2f1fb8bddf97e143af6613514538a0c7157bcd | 118 ++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 d3/2f1fb8bddf97e143af6613514538a0c7157bcd diff --git a/d3/2f1fb8bddf97e143af6613514538a0c7157bcd b/d3/2f1fb8bddf97e143af6613514538a0c7157bcd new file mode 100644 index 000000000..8c8d600ef --- /dev/null +++ b/d3/2f1fb8bddf97e143af6613514538a0c7157bcd @@ -0,0 +1,118 @@ +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 7EADB431FAF + for ; Sun, 25 Nov 2012 06:31:53 -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 AE3q1EUdB+U4 for ; + Sun, 25 Nov 2012 06:31:53 -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 BAC1A431FAE + for ; Sun, 25 Nov 2012 06:31:52 -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 1TcdFN-0005IS-OZ; Sun, 25 Nov 2012 14:31:50 +0000 +Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) + by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) + (envelope-from ) + id 1TcdFN-000037-Eq; Sun, 25 Nov 2012 14:31:49 +0000 +From: Mark Walters +To: Austin Clements , notmuch@notmuchmail.org +Subject: Re: [PATCH 0/6] API for iterating over all messages in a thread +In-Reply-To: <1353819427-13182-1-git-send-email-amdragon@mit.edu> +References: <1353819427-13182-1-git-send-email-amdragon@mit.edu> +User-Agent: Notmuch/0.14+81~g9730584 (http://notmuchmail.org) Emacs/23.4.1 + (x86_64-pc-linux-gnu) +Date: Sun, 25 Nov 2012 14:31:53 +0000 +Message-ID: <87ehjhkb3a.fsf@qmul.ac.uk> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +X-Sender-Host-Address: 93.97.24.31 +X-QM-SPAM-Info: Sender has good ham record. :) +X-QM-Body-MD5: 16a83e3a07d2e2f1f8cd05b77f6d967f (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.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: Sun, 25 Nov 2012 14:31:53 -0000 + + +Hi + +This series looks good to me (I have not reviewed the two bindings +patches). Patch 2 looks like it makes things much easier to follow than +the current code (if I understood the current pointer stuff it +constructs the top-level list by doing pointer stuff to remove all +messages which are replies from the complete message list). Indeed, the +diff is more complicated than the new code! + +On Sun, 25 Nov 2012, Austin Clements wrote: +> This series adds a library API for iterating over all messages in a +> thread in sorted order. This is easy for the library to provide and +> difficult to obtain from the current API. Plus, if you don't count +> the code added to the bindings, this series is actually a net +> decrease of 4 lines of code because of simplifications it enables. +> +> Do we want the API to do more? Currently it's very minimal, but I can +> imagine two ways it could be generalized. It could take an argument +> to indicate which message list to return, which could be all messages, +> matched messages, top-level messages, or maybe even unmatched messages +> (possibly all in terms of message flags). It could also take an +> argument indicating the desired sort order. Currently, the caller can +> use existing message flag APIs to distinguish matched and unmatched +> messages and there's a separate function for the top-level messages. +> However, if the API could do all of these things, it would subsume +> various other API functions, such as notmuch_thread_get_*_date. + +I don't know if this is the right API. For the matched message etc I +think using the existing message flag APIs is simple enough. I am not +sure about sort orders though: that looks like it would be much easier +for the caller to have the correct sort by I am not sure what users +would need it. + +Best wishes + +Mark + + + + +> +> Also, is this the right name for the new API? In particular, if we do +> later want to add a function that returns, say, the list of matched +> messages, we'll have a convention collision with +> notmuch_thread_get_matched_messages, which returns only a count. -- 2.26.2