--- /dev/null
+Return-Path: <jani@nikula.org>\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 409156DE18FB\r
+ for <notmuch@notmuchmail.org>; Mon, 5 Oct 2015 11:27:59 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.154\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.154 tagged_above=-999 required=5\r
+ tests=[AWL=-0.178, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, URIBL_SBL=0.644, URIBL_SBL_A=0.1]\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 GbQgLa7Hs-wk for <notmuch@notmuchmail.org>;\r
+ Mon, 5 Oct 2015 11:27:56 -0700 (PDT)\r
+Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com\r
+ [209.85.212.170])\r
+ by arlo.cworth.org (Postfix) with ESMTPS id 436C36DE157C\r
+ for <notmuch@notmuchmail.org>; Mon, 5 Oct 2015 11:27:56 -0700 (PDT)\r
+Received: by wicgb1 with SMTP id gb1so132114912wic.1\r
+ for <notmuch@notmuchmail.org>; Mon, 05 Oct 2015 11:27:54 -0700 (PDT)\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:in-reply-to:references\r
+ :user-agent:date:message-id:mime-version:content-type;\r
+ bh=EXSjhfs+/nqY0XeD26ZkKT43HRQ30raJmtD2iNa3+9M=;\r
+ b=gpmKUyanEMeAjWgjDo4YhPi2k5hx2XQs6/UnwoxQd8X5IiNQGeuSplgJtjgC6jnIeI\r
+ aZOOnhDTiZBHGlG7ZszEDTSmPRnOwcLjyJC7dOXaGLqdNa7+eXy7D7Hy//ORMAhJGLvT\r
+ lXXPoYrk4VzfHoumwyRa7qpXgpVcE994sEFVDdMH9U4DOKmDkh2kgfD8j0a1xZpvv+KM\r
+ ll27vm0o8BkmGt2Z4G19LMWdjmz/i/iGSjfeEIPf5FQuumx+ixxjuQjca8QRIc3agIUk\r
+ YiowfO+vAJUMnspe8Mz2kPaVhTRhGf1W7jf/dIeNv9zYw0d+opHgB8WS8NgoikCvF7sa\r
+ tIRw==\r
+X-Gm-Message-State:\r
+ ALoCoQlL1M7RFvVi0Ij6NNsbNhkUeL+UxmL+OvChdWltUe2lVWOWa48+VsRk4Ee50hKQ+u9rN1PL\r
+X-Received: by 10.194.92.166 with SMTP id cn6mr31968460wjb.6.1444069674480;\r
+ Mon, 05 Oct 2015 11:27:54 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee9f-54.dhcp.inet.fi.\r
+ [188.238.159.54])\r
+ by smtp.gmail.com with ESMTPSA id go2sm15908278wib.20.2015.10.05.11.27.53\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Mon, 05 Oct 2015 11:27:54 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: David Bremner <david@tethera.net>, notmuch@notmuchmail.org\r
+Subject: Re: [Patch v4 8/9] lib: migrate thread.cc to new query_search API\r
+In-Reply-To: <1443367923-11867-9-git-send-email-david@tethera.net>\r
+References: <1443367923-11867-1-git-send-email-david@tethera.net>\r
+ <1443367923-11867-9-git-send-email-david@tethera.net>\r
+User-Agent: Notmuch/0.20.2+101~g7b7dadb (http://notmuchmail.org) Emacs/24.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Mon, 05 Oct 2015 21:27:28 +0300\r
+Message-ID: <878u7h892n.fsf@nikula.org>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Mon, 05 Oct 2015 18:27:59 -0000\r
+\r
+On Sun, 27 Sep 2015, David Bremner <david@tethera.net> wrote:\r
+> here we rely on thread_id_query being attached to the local talloc\r
+> context, so no new cleanup code is needed.\r
+\r
+LGTM\r
+\r
+> ---\r
+> lib/thread.cc | 9 ++++++---\r
+> 1 file changed, 6 insertions(+), 3 deletions(-)\r
+>\r
+> diff --git a/lib/thread.cc b/lib/thread.cc\r
+> index c8e58c3..0c937d7 100644\r
+> --- a/lib/thread.cc\r
+> +++ b/lib/thread.cc\r
+> @@ -447,6 +447,7 @@ _notmuch_thread_create (void *ctx,\r
+> \r
+> notmuch_messages_t *messages;\r
+> notmuch_message_t *message;\r
+> + notmuch_status_t status;\r
+> \r
+> seed_message = _notmuch_message_create (local, notmuch, seed_doc_id, NULL);\r
+> if (! seed_message)\r
+> @@ -504,9 +505,11 @@ _notmuch_thread_create (void *ctx,\r
+> * oldest or newest subject is desired. */\r
+> notmuch_query_set_sort (thread_id_query, NOTMUCH_SORT_OLDEST_FIRST);\r
+> \r
+> - /* XXX: this should use the _st version, but it needs an error path\r
+> - */\r
+> - for (messages = notmuch_query_search_messages (thread_id_query);\r
+> + status = notmuch_query_search_messages_st (thread_id_query, &messages);\r
+> + if (status)\r
+> + goto DONE;\r
+> +\r
+> + for (;\r
+> notmuch_messages_valid (messages);\r
+> notmuch_messages_move_to_next (messages))\r
+> {\r
+> -- \r
+> 2.5.3\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r