From: Carl Worth Date: Tue, 9 Mar 2010 17:36:10 +0000 (+1600) Subject: Re: [notmuch] [PATCH] Added regress option to tags iterator X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=03447d932cc28e0064db3d22eae3bdbd113cac5f;p=notmuch-archives.git Re: [notmuch] [PATCH] Added regress option to tags iterator --- diff --git a/66/74f98af7eb8166b5613f79bbcd55b6dba9dc9f b/66/74f98af7eb8166b5613f79bbcd55b6dba9dc9f new file mode 100644 index 000000000..a881738e8 --- /dev/null +++ b/66/74f98af7eb8166b5613f79bbcd55b6dba9dc9f @@ -0,0 +1,119 @@ +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 6F104476B9A + for ; Tue, 9 Mar 2010 12:02:50 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -2.022 +X-Spam-Level: +X-Spam-Status: No, score=-2.022 tagged_above=-999 required=5 + tests=[ALL_TRUSTED=-1.8, AWL=-0.223, BAYES_50=0.001] autolearn=ham +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 c+b+G5hU0Ks0; Tue, 9 Mar 2010 12:02:49 -0800 (PST) +Received: from yoom.home.cworth.org (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id C0B85476B97; + Tue, 9 Mar 2010 12:02:49 -0800 (PST) +Received: by yoom.home.cworth.org (Postfix, from userid 1000) + id DE1F954C004; Tue, 9 Mar 2010 09:36:16 -0800 (PST) +From: Carl Worth +To: Ruben Pollan , notmuch@notmuchmail.org +In-Reply-To: <87pr67ofz2.fsf@yoom.home.cworth.org> +References: <20091126202347.GA16654@blackspot> + <1260364206-344-1-git-send-email-meskio@sindominio.net> + <20091209132446.GC23878@blackspot> + <877hsv6hbo.fsf@yoom.home.cworth.org> + <87r5qnol78.fsf@yoom.home.cworth.org> + <87pr67ofz2.fsf@yoom.home.cworth.org> +Date: Tue, 09 Mar 2010 09:36:10 -0800 +Message-ID: <873a09jt2t.fsf@yoom.home.cworth.org> +MIME-Version: 1.0 +Content-Type: multipart/signed; boundary="=-=-="; + micalg=pgp-sha1; protocol="application/pgp-signature" +Subject: Re: [notmuch] [PATCH] Added regress option to tags iterator +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +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, 09 Mar 2010 20:02:50 -0000 + +--=-=-= +Content-Transfer-Encoding: quoted-printable + +On Mon, 21 Dec 2009 19:16:49 -0800, Carl Worth wrote: +> One option is to just drop the "move_ " prefix. Then everything will be +> a two-word function. So the new proposal is: +>=20 +> to_first +> has_current +> to_next +>=20 +> to_last +> has_current +> to_previous +>=20 +> get_current +>=20 +> Better? + +Looking back at this proposal now, (after a long delay), I found I +didn't like it at all. With function names like: + + notmuch_threads_to_first + notmuch_threads_to_next + +the missing verb in the name is really distracting. I ended up reading +these names as if they were conversion functions. So I've gone back to +preferring the names with the explicit verbs (even though quite long): + + notmuch_threads_move_to_first + notmuch_threads_move_to_next + +Meanwhile, I also decided that _current wasn't adding anything to the +names it showed up in, (we can never "get" anything other than the +current item, so why qualify as "get_current"?). So I'm changing from +"has_current" to "valid", and leaving "get" as it is. + +So the final proposal for iteration in either direction is: + + move_to_first + valid + move_to_next + + move_to_last + valid + move_to_previous + + get + +I've just pushed commits changing the existing functions (which allow +only forward iteration) to use this naming scheme. I haven't added any +of the reverse-iteration functions yet, so Ruben, if you'd like to do +those within this scheme, that would be find. (Or we could wait until we +have an actual use in mind for them.) + +Thanks, + +=2DCarl + +--=-=-= +Content-Type: application/pgp-signature + +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.10 (GNU/Linux) + +iD8DBQFLlocL6JDdNq8qSWgRAngCAKCOC1FhXomVg/nqQhct0ChFEXj/HgCfRAoj +wJS2YBSFaiEi3Teya+Du/UI= +=l7qE +-----END PGP SIGNATURE----- +--=-=-=--