[sup-talk] viewing threads oldest-first

William Morgan wmorgan-sup at masanjin.net
Fri Mar 14 14:30:58 EDT 2008

Reformatted excerpts from Matt Liggett's message of 2008-03-14:
> In every mailer I've used before my gmail days, I always viewed my
> email oldest first, especially in any inboxen.  Is there a config
> option (I don't see a keyboard shortcut) to do this?

There's no option for this. I don't think it makes quite as much sense
in a world where mailboxes can be arbitrarily large (a Sup mailbox is a
search result across your entire set of email) and where loading is
fairly slow.

But there's no technical reason why this couldn't happen, and other
people have asked for it before, so I'd be willing to add it.

> As I write this, I realize that oldest-first might mean different
> things in a threaded view.  Is that the oldest first message in the
> thread, or the oldest last message?

Currently a thread's timestamp is the timestamp of the most recent
message in it, and I would be loathe to change that.

> Do I generally want inbox threads sorted by unread messages (that is,
> ordering by oldest unread message in each thread)? 

That would be interesting, but unfortunately is not feasible in Sup. The
index currently knows nothing about threads, just individual messages,
so we can only sort by properties of messages, not by properties of

The way we build a threadset now is we search for messages which meet
some search criterea, then we build a thread for each message.

> In the meantime, can anyone give me a pointer as to where in the code
> I might start digging regarding such a feature?

Normally I would want a hook, but since there are really only two
options that are technically feasible now, I would add a config variable
called "sort_oldest_first" or something like that.  It will follow a
very similar codepath to thread_by_subj (so grep for that): it should be
initialized in sup.rb for new configurations, passed into a ThreadSet
constructor from ThreadIndexMode#initialize_threads, and passed into
Index#each_id_by_date, where it will change the query we send to Ferret.
Finally, ThreadIndexMode#update (which handles the UI component of
sorting) has got to respect this variable.

> I tried mutt+mairix for awhile, but it was kludgy and slow.  sup looks
> like it might be the best of both worlds, enabling me to deal with a
> large volume of mail and still giving me the tagging and search that I
> love from gmail.

Yep, you're my target audience. :)

William <wmorgan-sup at masanjin.net>

More information about the sup-talk mailing list