From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id UGEoA9Gc/GMxFwEAbAwnHQ (envelope-from ) for ; Mon, 27 Feb 2023 13:06:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id MLQiA9Gc/GNhIAEAauVa8A (envelope-from ) for ; Mon, 27 Feb 2023 13:06:41 +0100 Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id D65AFE625 for ; Mon, 27 Feb 2023 13:06:40 +0100 (CET) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 517D65F378; Mon, 27 Feb 2023 12:06:38 +0000 (UTC) Received: from out-24.mta1.migadu.com (out-24.mta1.migadu.com [95.215.58.24]) by mail.notmuchmail.org (Postfix) with ESMTPS id 770F75F360 for ; Mon, 27 Feb 2023 12:06:35 +0000 (UTC) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boula.in; s=key1; t=1677499595; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=rrWuNgE0S2r7j3ZkONCwiCTIHvkg1lwi43ttHOrfA4g=; b=mqz8IYJ5b5yXba8++WrA8ANh/NZLp68WLum7+1ZtXaQE0fG58iNIBcVf9yCUQNVfvpLibx IVShaootxHG0Kp7BecXSKkIeTyzcYWkAhQGXkinKmNbdSazzOBna3XNIw18vRRCJJj7zMB RyvKZCzeH07BqDqGvBaeBxDlKPhhD/fmwhjrCVpW4FnKio0GRK/dVzY/LQtvqsb4UkpPdo BHv9nc7NS+x4LQCSRa5A5LdMXVOQ+i3QWION915Aw41bAGigLV8fFl/o3wcfGyFWMyV5o9 B76zGLbpLlk1jc+nFzdGztaPAmykLkKBUpRIkhapxw0mI0CNb91q8hJlwYFofQ== From: Kevin Boulain To: notmuch@notmuchmail.org Subject: [PATCH 1/1] lib/notmuch: update example Date: Mon, 27 Feb 2023 13:06:29 +0100 Message-Id: <20230227120629.59942-1-kevin@boula.in> In-Reply-To: <87fsasvevy.fsf@tethera.net> References: <87fsasvevy.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: ALG4ZIHE5HU76C6SDPBYBYG3ZZW6XM6B X-Message-ID-Hash: ALG4ZIHE5HU76C6SDPBYBYG3ZZW6XM6B X-MailFrom: kevin@boula.in X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0 CC: Kevin Boulain X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE ARC-Seal: i=1; s=key1; d=yhetil.org; t=1677499600; a=rsa-sha256; cv=none; b=dLkOoV2cCJgGOVfjSs29rSKdtxauRiOfcTHghzoTuhTEixjdBDlnJilxhm0N72GQDvAteO QX2zQ4lPHPNmmrcwM4DGzhRx0fl+i/Xq99CCs0uwuV1fvybfqejIAqJmZilfJB/oqHbndB lR2OIDAHvGt0To/qPPYaTFK8tPcFMs8ABTGb/Wb1ZtMsopRiRMm+XmjPkNeaiL0uecN22j gII5cF+68YeS/FipXfYimWFa5yShv6KjEzZ1SPKU+FB9F69nRJnUNaD3jgBaucv/WaZTyZ MD7DYUlhWaLkKSmHGbSF5mQYNqVPtyRtgiTnVJPloMqJ0N1pZtPWeuAJxHKoJw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=boula.in header.s=key1 header.b=mqz8IYJ5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=boula.in (policy=quarantine); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1677499600; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=XIjhskbBGSmJzt34Zq6TQjY74Vmew1ifhWghTeE2Bvg=; b=FhzPB2ZKzEoCYj+NpSguVD7Y+RvSqGmlyoTP59CUEx4OF0vWTYhUPlumMpF3XjrYnItt90 7V9zEbedU4cHf/OpmhDuGwAhQq6DiZj/zeY0Lp789ZtRmFwrNvjcVOvYzCNtv8gAPG8q4j Vu3gnUL9KZkHzRxJBexWmmhnuQWctH5IAYVYZY7maZQzf5/Z2JTttKxy6eOo6jXvFIA4fm Qmhb2p7qd3DoQ45k7lKpReqtDe+G9cNUzXtcqVfCwNryO3V0256VG+gXY4b8/pWdiNNiND GHF6K54cTGGKsYxFMmc1KtTyvj1tpSmoxS6OsCPacrKik42u+m36j93eXL/KgA== X-Spam-Score: 6.00 X-Migadu-Queue-Id: D65AFE625 X-Migadu-Spam: Yes X-Spam: Yes Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=boula.in header.s=key1 header.b=mqz8IYJ5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=boula.in (policy=quarantine); spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: 6.00 X-TUID: 7oDGDlP316jN Likely missed in 86cbd215e, when notmuch_query_search_messages_st was renamed to notmuch_query_search_messages. --- > I don't think we should encourage people to ignore the status code. Makes sense, I wasn't too sure if the example was deliberately minimal. lib/notmuch.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/notmuch.h b/lib/notmuch.h index ce375c04..89018392 100644 --- a/lib/notmuch.h +++ b/lib/notmuch.h @@ -1172,7 +1172,10 @@ notmuch_query_search_threads_st (notmuch_query_t *query, notmuch_threads_t **out * * query = notmuch_query_create (database, query_string); * - * for (messages = notmuch_query_search_messages (query); + * if (notmuch_query_search_messages (query, &messages) != NOTMUCH_STATUS_SUCCESS) + * return EXIT_FAILURE; + * + * for (; * notmuch_messages_valid (messages); * notmuch_messages_move_to_next (messages)) * {