On Thu, 26 Nov 2009 21:23:47 +0100, Ruben Pollan <meskio at sindominio.net> 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