--- /dev/null
+Return-Path: <bremner@tesseract.cs.unb.ca>\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 8E8796DE15BE\r
+ for <notmuch@notmuchmail.org>; Sun, 7 Jun 2015 08:05:03 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.22\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.22 tagged_above=-999 required=5 tests=[AWL=0.210,\r
+ T_HEADER_FROM_DIFFERENT_DOMAINS=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 YdF0d_b9oP4S for <notmuch@notmuchmail.org>;\r
+ Sun, 7 Jun 2015 08:05:01 -0700 (PDT)\r
+Received: from mx.xen14.node3324.gplhost.com (gitolite.debian.net\r
+ [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 90DEE6DE1641\r
+ for <notmuch@notmuchmail.org>; Sun, 7 Jun 2015 08:05:01 -0700 (PDT)\r
+Received: from remotemail by mx.xen14.node3324.gplhost.com with local (Exim\r
+ 4.80) (envelope-from <bremner@tesseract.cs.unb.ca>)\r
+ id 1Z1c7Y-0004pQ-2i; Sun, 07 Jun 2015 15:04:20 +0000\r
+Received: (nullmailer pid 7856 invoked by uid 1000); Sun, 07 Jun 2015\r
+ 15:02:11 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 04/10] lib: remove use of notmuch_query_search_messages from\r
+ query.cc\r
+Date: Sun, 7 Jun 2015 17:01:57 +0200\r
+Message-Id: <1433689323-7520-5-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1433689323-7520-1-git-send-email-david@tethera.net>\r
+References: <1433689323-7520-1-git-send-email-david@tethera.net>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\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: Sun, 07 Jun 2015 15:05:03 -0000\r
+\r
+There is not too much point in worrying about the bad error reporting\r
+here, because the count api is due for the same deprecation.\r
+---\r
+ lib/query.cc | 6 +++++-\r
+ 1 file changed, 5 insertions(+), 1 deletion(-)\r
+\r
+diff --git a/lib/query.cc b/lib/query.cc\r
+index 5275b5a..f53215d 100644\r
+--- a/lib/query.cc\r
++++ b/lib/query.cc\r
+@@ -618,10 +618,14 @@ notmuch_query_count_threads (notmuch_query_t *query)\r
+ GHashTable *hash;\r
+ unsigned int count;\r
+ notmuch_sort_t sort;\r
++ notmuch_status_t status;\r
+ \r
+ sort = query->sort;\r
+ query->sort = NOTMUCH_SORT_UNSORTED;\r
+- messages = notmuch_query_search_messages (query);\r
++ status = notmuch_query_search_messages_st (query, &messages);\r
++ if (status)\r
++ return 0;\r
++\r
+ query->sort = sort;\r
+ if (messages == NULL)\r
+ return 0;\r
+-- \r
+2.1.4\r
+\r