<<< Date Index >>>     <<< Thread Index >>>

reverse buffy-cycle ?



        Hi!

        I have lots of mailboxes (Maildirs, actually) defined with the
"mailboxes" command and use SPACE (default bind for <buffy-cycle> to cycle
through the ones with new messages.

        However, if I'm cycling and press one space too many, I'm forced to
press LOTS of spaces until I get to the mailbox I was trying to reach in the
first place (that is, I have to start cycling all over again, or manually
enter de mailbox name).

        I looked briefly at the source code and couldn't find a
"reverse-buffy-cycle", something that cycles in the reverse direction (that
is, if I cycled over the mailbox I was trying to reach, I could press, say,
<ESC><SPACE> and cycle backwards to it). Does something like this exist?
Could it be easily implemented?

        I read some of the mutt source code and noticed the folders defined
by the "mailboxes" command are kept in the BUFFY struct "Incoming". This has
an attribute "next", and so the cycling occurs in the order in which the
folders were defined. mutt_buffy() "gives the next incoming folder with new
mail" (BTW, the code in mutt 1.5.4-1 (Debian) reads "new new mail").

        The BUFFY struct doesn't have a "prev" attribute, so I think
reverse-buffy-cycle could be implemented by building a list in the reverse
order, or by adding a "prev" attribute to BUFFY and having a
mutt_rev_buffy() cycle through Incoming in the reverse order (which seems to
be "the right way").

        Do you guys have any thoughts on this? Am I going in the right
direction? Would it be worth it for me to produce a patch?

        TIA,



                rbp
-- 
 Rodrigo Bernardo Pimentel                         <rbp@xxxxxxxxxxxx>
 http://isnomore.net                          GPG KeyId: <0x0DB14978>

... And pretty much everyone agreed that he was on the right track,
for some definition of "right" (and "track").
          -- Larry Wall