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 B476E431FBC for ; Fri, 31 Aug 2012 14:00:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[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 WJ1WEDScjP70 for ; Fri, 31 Aug 2012 14:00:47 -0700 (PDT) Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36]) by olra.theworths.org (Postfix) with ESMTP id 19953431FAF for ; Fri, 31 Aug 2012 14:00:47 -0700 (PDT) Received: from localhost (unknown [192.168.200.4]) by max.feld.cvut.cz (Postfix) with ESMTP id C4A8A3CFE71; Fri, 31 Aug 2012 23:00:42 +0200 (CEST) X-Virus-Scanned: IMAP AMAVIS Received: from max.feld.cvut.cz ([192.168.200.1]) by localhost (styx.feld.cvut.cz [192.168.200.4]) (amavisd-new, port 10044) with ESMTP id h8X4-glOLo_r; Fri, 31 Aug 2012 23:00:41 +0200 (CEST) Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34]) by max.feld.cvut.cz (Postfix) with ESMTP id 53DFA19F3379; Fri, 31 Aug 2012 23:00:41 +0200 (CEST) Received: from steelpick.2x.cz (unknown [213.29.198.144]) (Authenticated sender: sojkam1) by imap.feld.cvut.cz (Postfix) with ESMTPSA id 3D478660904; Fri, 31 Aug 2012 23:00:41 +0200 (CEST) Received: from wsh by steelpick.2x.cz with local (Exim 4.80) (envelope-from ) id 1T7YKW-0002DZ-PY; Fri, 31 Aug 2012 23:00:40 +0200 From: Michal Sojka To: Jameson Graef Rollins , Notmuch Mail Subject: Re: [PATCH 08/11] cli: add thread recipients to search output In-Reply-To: <1345427570-26518-9-git-send-email-jrollins@finestructure.net> References: <1345427570-26518-1-git-send-email-jrollins@finestructure.net> <1345427570-26518-2-git-send-email-jrollins@finestructure.net> <1345427570-26518-3-git-send-email-jrollins@finestructure.net> <1345427570-26518-4-git-send-email-jrollins@finestructure.net> <1345427570-26518-5-git-send-email-jrollins@finestructure.net> <1345427570-26518-6-git-send-email-jrollins@finestructure.net> <1345427570-26518-7-git-send-email-jrollins@finestructure.net> <1345427570-26518-8-git-send-email-jrollins@finestructure.net> <1345427570-26518-9-git-send-email-jrollins@finestructure.net> User-Agent: Notmuch/0.14+3~g608c52f (http://notmuchmail.org) Emacs/24.1.1 (x86_64-pc-linux-gnu) Date: Fri, 31 Aug 2012 23:00:40 +0200 Message-ID: <877gseojyf.fsf@steelpick.2x.cz> MIME-Version: 1.0 Content-Type: text/plain 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: Fri, 31 Aug 2012 21:00:48 -0000 On Mon, Aug 20 2012, Jameson Graef Rollins wrote: > This adds a "--include-recipients" option to notmuch search. With > structured output formats (e.g. json), a new recipients field will be > included that holds recipients of the thread. Matched and non-matched > recipients are delineated as with authors. > > As mentioned in the previous patch for the underlying lib functions, > the need for the option is because message recipients are not stored > in the database and therefore retrieving them adds a significant > overhead. If they were included, this option would not be necessary. > --- > lib/notmuch.h | 6 +++++- > lib/query.cc | 5 +++-- > notmuch-search.c | 14 +++++++++++--- > notmuch-show.c | 2 +- > test/json | 1 - > 5 files changed, 20 insertions(+), 8 deletions(-) > > diff --git a/lib/notmuch.h b/lib/notmuch.h > index f9e71c1..8eb455e 100644 > --- a/lib/notmuch.h > +++ b/lib/notmuch.h > @@ -642,6 +642,9 @@ notmuch_threads_valid (notmuch_threads_t *threads); > > /* Get the current thread from 'threads' as a notmuch_thread_t. > * > + * If the include_recipients flag is TRUE, thread recipients will be > + * included in the returned thread object. > + * > * Note: The returned thread belongs to 'threads' and has a lifetime > * identical to it (and the query to which it belongs). > * > @@ -652,7 +655,8 @@ notmuch_threads_valid (notmuch_threads_t *threads); > * NULL. > */ > notmuch_thread_t * > -notmuch_threads_get (notmuch_threads_t *threads); > +notmuch_threads_get (notmuch_threads_t *threads, > + notmuch_bool_t include_recipients); What about adding a new function notmuch_threds_get_with_recipients() to not break public API? It would also make the sources more readable. -M.