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 D9D33431FC0; Fri, 27 Nov 2009 19:58:14 -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 V2n7Dn6bLhKj; Fri, 27 Nov 2009 19:58:14 -0800 (PST) Received: from cworth.org (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 2DECD431FAE; Fri, 27 Nov 2009 19:58:14 -0800 (PST) From: Carl Worth To: Ruben Pollan , notmuch@notmuchmail.org In-Reply-To: <20091126202347.GA16654@blackspot> References: <20091126202347.GA16654@blackspot> Date: Fri, 27 Nov 2009 19:57:59 -0800 Message-ID: <87pr73jo6w.fsf@yoom.home.cworth.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [notmuch] notmuch_threads_back and notmuch_messages_back 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: Sat, 28 Nov 2009 03:58:15 -0000 On Thu, 26 Nov 2009 21:23:47 +0100, Ruben Pollan wrote: > Is it possible to implement notmuch_threads_back and notmuch_messages_back? > And I guess will make sense to have also notmuch_tags_back. > > This functions will do the oposite than notmuch_threads_advance and > notmuch_messages_advance. So I can use them as iterators going back and forward. > > I didn't check the implementation of notmuch. I don't know if will be easy or > will need to redesign a lot of code. Most cases of these iterators are built on Xapian iterators, (C++ objects with overloaded operators). So those are just using ++ for advance() and can easily use -- for the new function, (I'd like a verb that pairs better with "advance" than the non-verb "back"---any suggestions)? So those won't need any new code. The one case that will need new code is that for notmuch_message_get_replies and notmuch_message_get_toplevel_messages the messages iterator is currently built on a singly-linked list. Making it doubly linked would obviously not be hard though. -Carl