[notmuch] notmuch_threads_back and notmuch_messages_back

2009-12-07 Thread Carl Worth
On Sun, 6 Dec 2009 18:34:37 +0100, Ruben Pollan  
wrote:
> Do I miss something? Or the function is just designed to work on a single node
> not a list of them?

The latter. The documentation for the function is wrong. Sorry about that.

-Carl
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: 



[notmuch] notmuch_threads_back and notmuch_messages_back

2009-12-06 Thread Ruben Pollan
On 19:57, Fri 27 Nov 09, Carl Worth wrote:
> (I'd like a verb that pairs better
> with "advance" than the non-verb "back"---any suggestions)?

What about regress?
I'm not a native English speaker, so maybe someone can suggest something better.

> 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.

I'm trying to convert it to a doubly linked list, but I'm not sure if I
understand well how they work.

I don't see how _notmuch_message_list_append works. It says "node can of course
point to an arbitrarily long list of nodes", but the code is:

void
_notmuch_message_list_append (notmuch_message_list_t *list,
  notmuch_message_node_t *node)
{   
*(list->tail) = node;
list->tail = >next;
}

Should not be something like:

void
_notmuch_message_list_append (notmuch_message_list_t *list,
  notmuch_message_node_t *node)
{   
notmuch_message_node_t *next_node;

*(list->tail) = node;
for (next_node = node->next; next_node->next != NULL;
 next_node = next_node->next);
list->tail = _node->next;
}

Do I miss something? Or the function is just designed to work on a single node
not a list of them?


-- 
Rub?n Poll?n  | jabber:meskio at jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
 No vamos a reivindicar nada,
no vamos a pedir nada.
Tomaremos, okuparemos.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 



[notmuch] notmuch_threads_back and notmuch_messages_back

2009-11-27 Thread Carl Worth
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


[notmuch] notmuch_threads_back and notmuch_messages_back

2009-11-26 Thread Ruben Pollan
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.

-- 
Rub?n Poll?n  | jabber:meskio at jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
   La felicidad no es hacer lo que deseas
 es desear lo que haces.

-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: