Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id E673C431FBF for ; Tue, 8 Dec 2009 01:55:28 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uwBTl+B96xAM for ; Tue, 8 Dec 2009 01:55:28 -0800 (PST) Received: from flatline.sindominio.net (flatline.sindominio.net [82.144.4.26]) by olra.theworths.org (Postfix) with ESMTP id 24FCA431FAE for ; Tue, 8 Dec 2009 01:55:28 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by flatline.sindominio.net (Postfix) with ESMTP id 79AE72626BA for ; Tue, 8 Dec 2009 10:55:27 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at sindominio.net Received: from flatline.sindominio.net ([127.0.0.1]) by localhost (flatline.sindominio.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 99wgXNDtNawt for ; Tue, 8 Dec 2009 10:55:24 +0100 (CET) Received: from blackspot (rpollan-laptop.cern.ch [137.138.192.228]) by flatline.sindominio.net (Postfix) with ESMTPA id B4FFD2626BF for ; Tue, 8 Dec 2009 10:55:24 +0100 (CET) Received: by blackspot (Postfix, from userid 1000) id 747308BC3B; Tue, 8 Dec 2009 10:57:32 +0100 (CET) Date: Tue, 8 Dec 2009 10:57:32 +0100 From: ruben pollan To: notmuch@notmuchmail.org Message-ID: <20091208095732.GB8021@blackspot> References: <20091126202347.GA16654@blackspot> <1260265292-12591-1-git-send-email-meskio@sindominio.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7DO5AaGCk89r4vaK" Content-Disposition: inline In-Reply-To: <1260265292-12591-1-git-send-email-meskio@sindominio.net> User-Agent: Mutt/1.5.20 (2009-06-14) Subject: Re: [notmuch] regress option to messages iterator X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2009 09:55:29 -0000 --7DO5AaGCk89r4vaK Content-Type: multipart/mixed; boundary="bAmEntskrkuBymla" Content-Disposition: inline --bAmEntskrkuBymla Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Attached to this email I add a small code that use this functions, as an example. On 10:41, Tue 08 Dec 09, meskio@sindominio.net wrote: > Two patches for implement the regress functions on messages. With them=20 > notmuch_messages_t can be use as an iterator forwards and backwards. >=20 > Up to now not really useful, nothing use them. I send them mainly to revi= ew. > I'll do the same to threads and tags, so the UIs can use them. >=20 > PS: It's the first time I'm using git-send-email, I hope I do everything = well. >=20 > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch >=20 --=20 Rub=E9n Poll=E1n | jabber:meskio@jabber.org -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-= =3D-=3D-=3D-=3D-=3D- Si luchas puedes perder Si no luchas estas perdido --bAmEntskrkuBymla Content-Type: text/x-csrc; charset=us-ascii Content-Disposition: attachment; filename="foo.c" #include #include "lib/notmuch.h" void show_message (notmuch_message_t *message) { printf ("%s\n", notmuch_message_get_message_id (message)); } int main () { notmuch_database_t *database; notmuch_query_t *query; notmuch_messages_t *messages; notmuch_message_t *message; char ch = '\0'; database = notmuch_database_open ("/home/meskio/Maildir", NOTMUCH_DATABASE_MODE_READ_ONLY); query = notmuch_query_create (database, "inbox"); messages = notmuch_query_search_messages (query); while (ch != 'q') { message = notmuch_messages_get (messages); show_message (message); ch = getchar(); if (ch == 'n') { notmuch_messages_advance (messages); if (!notmuch_messages_has_more (messages)) notmuch_messages_regress (messages); } else if (ch == 'p') { if (!notmuch_messages_is_first (messages)) notmuch_messages_regress (messages); } } } --bAmEntskrkuBymla-- --7DO5AaGCk89r4vaK Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iEYEARECAAYFAkseIwwACgkQGKOQ92SwNMKYCwCfTvv1QcQg9RspX77XtZEiwHPh C2cAoI7xoyRH8e38LQz/RCQHUnuU5ICP =07mC -----END PGP SIGNATURE----- --7DO5AaGCk89r4vaK--