--- /dev/null
+Return-Path: <david@tethera.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 08F996DE0243\r
+ for <notmuch@notmuchmail.org>; Tue, 5 Apr 2016 18:52:33 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.02\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.02 tagged_above=-999 required=5 tests=[AWL=-0.009,\r
+ SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id jl9omuCsEOpl for <notmuch@notmuchmail.org>;\r
+ Tue, 5 Apr 2016 18:52:25 -0700 (PDT)\r
+Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 0BD0C6DE01F7\r
+ for <notmuch@notmuchmail.org>; Tue, 5 Apr 2016 18:52:24 -0700 (PDT)\r
+Received: from remotemail by fethera.tethera.net with local (Exim 4.84)\r
+ (envelope-from <david@tethera.net>)\r
+ id 1anceQ-0005T3-DU; Tue, 05 Apr 2016 21:52:58 -0400\r
+Received: (nullmailer pid 22103 invoked by uid 1000);\r
+ Wed, 06 Apr 2016 01:52:22 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,\r
+ Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH v2 4/7] Add internal functions to search for alternate doc\r
+ types\r
+In-Reply-To: <1459606541-23889-4-git-send-email-dkg@fifthhorseman.net>\r
+References: <1459445693-3900-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1459606541-23889-1-git-send-email-dkg@fifthhorseman.net>\r
+ <1459606541-23889-4-git-send-email-dkg@fifthhorseman.net>\r
+User-Agent: Notmuch/0.21+74~g6c60fb1 (http://notmuchmail.org) Emacs/24.5.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 05 Apr 2016 22:52:22 -0300\r
+Message-ID: <87shyzfqqx.fsf@zancas.localnet>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://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: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Wed, 06 Apr 2016 01:52:33 -0000\r
+\r
+Daniel Kahn Gillmor <dkg@fifthhorseman.net> writes:\r
+\r
+> Publicly we are only exposing the non-ghost documents (of "type"\r
+> "mail"). But internally we might want to inspect the ghost messages\r
+> as well.\r
+>\r
+> This changeset adds two new private interfaces to queries to recover\r
+> information about alternate document types.\r
+> ---\r
+> lib/notmuch-private.h | 10 ++++++++++\r
+> lib/query.cc | 18 ++++++++++++++++--\r
+> 2 files changed, 26 insertions(+), 2 deletions(-)\r
+>\r
+> diff --git a/lib/notmuch-private.h b/lib/notmuch-private.h\r
+> index 5dd4770..cbfc144 100644\r
+> --- a/lib/notmuch-private.h\r
+> +++ b/lib/notmuch-private.h\r
+> @@ -477,6 +477,16 @@ void\r
+> _notmuch_doc_id_set_remove (notmuch_doc_id_set_t *doc_ids,\r
+> unsigned int doc_id);\r
+> \r
+> +notmuch_status_t\r
+> +_notmuch_query_search_messages_type_st (notmuch_query_t *query,\r
+> + const char *type,\r
+> + notmuch_messages_t **out);\r
+> +\r
+> +notmuch_status_t\r
+> +_notmuch_query_count_messages_type_st (notmuch_query_t *query,\r
+> + const char *type,\r
+> + unsigned *count_out);\r
+\r
+I was wondering if we should follow Xapian nomenclature and call these functions\r
+\r
+_notmuch_query_{search, count}_documents\r
+\r
+This assumes only going with the status returning versions\r