--- /dev/null
+Return-Path: <bremner@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 EF0066DE176C\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 19:52:07 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.112\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.112 tagged_above=-999 required=5 tests=[AWL=0.112]\r
+ 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 j9LxVyVnEY-A for <notmuch@notmuchmail.org>;\r
+ Sat, 26 Sep 2015 19:52:06 -0700 (PDT)\r
+Received: from gitolite.debian.net (gitolite.debian.net [87.98.215.224])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 3BA966DE141E\r
+ for <notmuch@notmuchmail.org>; Sat, 26 Sep 2015 19:52:06 -0700 (PDT)\r
+Received: from remotemail by gitolite.debian.net with local (Exim 4.80)\r
+ (envelope-from <bremner@tethera.net>)\r
+ id 1Zg23f-0005bX-SW; Sun, 27 Sep 2015 02:51:23 +0000\r
+Received: (nullmailer pid 31139 invoked by uid 1000); Sun, 27 Sep 2015\r
+ 02:50:26 -0000\r
+From: David Bremner <david@tethera.net>\r
+To: notmuch@notmuchmail.org\r
+Subject: [Patch v3 4/4] ruby: use new count API\r
+Date: Sat, 26 Sep 2015 23:50:13 -0300\r
+Message-Id: <1443322213-31075-5-git-send-email-david@tethera.net>\r
+X-Mailer: git-send-email 2.5.3\r
+In-Reply-To: <1443322213-31075-1-git-send-email-david@tethera.net>\r
+References: <1443322213-31075-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, 27 Sep 2015 02:52:08 -0000\r
+\r
+This change of replacing ignoring errors with exceptions is intended,\r
+and indeed one of the main motivations for the libnotmuch API changes.\r
+---\r
+ bindings/ruby/query.c | 24 ++++++++++++++----------\r
+ 1 file changed, 14 insertions(+), 10 deletions(-)\r
+\r
+diff --git a/bindings/ruby/query.c b/bindings/ruby/query.c\r
+index a7dacba..f87700a 100644\r
+--- a/bindings/ruby/query.c\r
++++ b/bindings/ruby/query.c\r
+@@ -173,14 +173,16 @@ VALUE\r
+ notmuch_rb_query_count_messages (VALUE self)\r
+ {\r
+ notmuch_query_t *query;\r
++ notmuch_status_t status;\r
++ unsigned int count;\r
+ \r
+ Data_Get_Notmuch_Query (self, query);\r
+ \r
+- /* Xapian exceptions are not handled properly.\r
+- * (function may return 0 after printing a message)\r
+- * Thus there is nothing we can do here...\r
+- */\r
+- return UINT2NUM(notmuch_query_count_messages(query));\r
++ status = notmuch_query_count_messages_st (query, &count);\r
++ if (status)\r
++ notmuch_rb_status_raise (status);\r
++\r
++ return UINT2NUM(count);\r
+ }\r
+ \r
+ /*\r
+@@ -192,12 +194,14 @@ VALUE\r
+ notmuch_rb_query_count_threads (VALUE self)\r
+ {\r
+ notmuch_query_t *query;\r
++ notmuch_status_t status;\r
++ unsigned int count;\r
+ \r
+ Data_Get_Notmuch_Query (self, query);\r
+ \r
+- /* Xapian exceptions are not handled properly.\r
+- * (function may return 0 after printing a message)\r
+- * Thus there is nothing we can do here...\r
+- */\r
+- return UINT2NUM(notmuch_query_count_threads(query));\r
++ status = notmuch_query_count_threads_st (query, &count);\r
++ if (status)\r
++ notmuch_rb_status_raise (status);\r
++\r
++ return UINT2NUM(count);\r
+ }\r
+-- \r
+2.5.3\r
+\r