[notmuch] reverse iterators

2010-03-22 Thread Ruben Pollan
On 21:07, Sun 21 Mar 10, Sebastian Spaeth wrote:
> On Sat, 20 Mar 2010 11:23:20 +0100, Ruben Pollan  
> wrote:
> > 
> > Adds support to reverse iteration on messages, threads and tags. To revew 
> > and
> > think if makes sense to include them on notmuch or wait until they have a 
> > real
> > use.
> 
> /me raises arm. Real use case here! Personally, I don't need the
> backwards operator (and I don't see the case where I would need to go
> back very often).

For me is pretty useful because I use the iterator as a cursor on an ncurses
notmuch interface. So the selected thread is where the iterator is and the user
can to go forward or backwards.

> But a _move_to_first() for threads, messages (and
> probably tags), would be really useful to me now:

:) Happy to see there is someone else needing it.


-- 
Rub?n Poll?n  | jabber:meskio at jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lo hago para no volverme loco cuando noto
que solo me queda un demonio en un hombro
por que se ha cortado las venas
el ?ngel que hab?a en el otro.
-- next part --
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: 



Re: [notmuch] reverse iterators

2010-03-22 Thread Ruben Pollan
On 21:07, Sun 21 Mar 10, Sebastian Spaeth wrote:
> On Sat, 20 Mar 2010 11:23:20 +0100, Ruben Pollan  
> wrote:
> > 
> > Adds support to reverse iteration on messages, threads and tags. To revew 
> > and
> > think if makes sense to include them on notmuch or wait until they have a 
> > real
> > use.
> 
> /me raises arm. Real use case here! Personally, I don't need the
> backwards operator (and I don't see the case where I would need to go
> back very often).

For me is pretty useful because I use the iterator as a cursor on an ncurses
notmuch interface. So the selected thread is where the iterator is and the user
can to go forward or backwards.

> But a _move_to_first() for threads, messages (and
> probably tags), would be really useful to me now:

:) Happy to see there is someone else needing it.


-- 
Rubén Pollán  | jabber:mes...@jabber.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Lo hago para no volverme loco cuando noto
que solo me queda un demonio en un hombro
por que se ha cortado las venas
el ángel que había en el otro.


signature.asc
Description: Digital signature
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] reverse iterators

2010-03-21 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 11:23:20 +0100, Ruben Pollan  
wrote:
> 
> Adds support to reverse iteration on messages, threads and tags. To revew and
> think if makes sense to include them on notmuch or wait until they have a real
> use.

/me raises arm. Real use case here! Personally, I don't need the
backwards operator (and I don't see the case where I would need to go
back very often). But a _move_to_first() for threads, messages (and
probably tags), would be really useful to me now:

Having bound notmuch.so to python, I am in a situation, where I can only
offer iteration once, with subsequent iterations failing. This is very
unexpected and very un-pythonesque. I fell myself over it:

#the below len() iterates and exhausts msgs
if len(msgs) > 0:
   for msg in msgs: print msg
   #above line fails horribly already...
else: print "No message for me!"

So, having a way to reset the iterator would be a real boon already now.

Sebastian


Re: [notmuch] reverse iterators

2010-03-21 Thread Sebastian Spaeth
On Sat, 20 Mar 2010 11:23:20 +0100, Ruben Pollan  wrote:
> 
> Adds support to reverse iteration on messages, threads and tags. To revew and
> think if makes sense to include them on notmuch or wait until they have a real
> use.

/me raises arm. Real use case here! Personally, I don't need the
backwards operator (and I don't see the case where I would need to go
back very often). But a _move_to_first() for threads, messages (and
probably tags), would be really useful to me now:

Having bound notmuch.so to python, I am in a situation, where I can only
offer iteration once, with subsequent iterations failing. This is very
unexpected and very un-pythonesque. I fell myself over it:

#the below len() iterates and exhausts msgs
if len(msgs) > 0:
   for msg in msgs: print msg
   #above line fails horribly already...
else: print "No message for me!"

So, having a way to reset the iterator would be a real boon already now.

Sebastian
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch


[notmuch] reverse iterators

2010-03-20 Thread Ruben Pollan

Adds support to reverse iteration on messages, threads and tags. To revew and
think if makes sense to include them on notmuch or wait until they have a real
use.

The patch 3 "Move the logic of threads iterator out of 'valid'" is just a 
reorganization of the code, I think it makes sense to include it in notmuch even
if we decide that the reverse iterators are not included.


[notmuch] reverse iterators

2010-03-20 Thread Ruben Pollan

Adds support to reverse iteration on messages, threads and tags. To revew and
think if makes sense to include them on notmuch or wait until they have a real
use.

The patch 3 "Move the logic of threads iterator out of 'valid'" is just a 
reorganization of the code, I think it makes sense to include it in notmuch even
if we decide that the reverse iterators are not included.
___
notmuch mailing list
notmuch@notmuchmail.org
http://notmuchmail.org/mailman/listinfo/notmuch