Subject: [sup-talk] viewing threads oldest-first

From: [email-masked] (Matt Liggett)
Date: Fri, 14 Mar 2008 11:01:41 -0400

Forgive me; I'm just getting started with sup and I'm trying to get
the hang of it, but I have not looked at the source yet, beyond a
cursory glance.

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?

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?  Do I generally want inbox threads
sorted by unread messages (that is, ordering by oldest unread message
in each thread)?  I'm not sure I know the answer to either question,
but I'm sure I'd like to be able to try all the choices.

I will try to start digging in to the code in the next few days,
because I am interested in contributing and making this better, not
least of all for myself.  In the meantime, can anyone give me a
pointer as to where in the code I might start digging regarding such a
feature?

FWIW, I was a long time mutt user but switched to gmail for search and
tagging.  I missed a lot of things, and I generally felt less able to
deal with large numbers of email conversations on a daily basis, but I
lived with it because "just archive and search" (and to a lesser
extent, tagging) was killer.

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.  Thanks, William!

-- 
Matt Liggett <mml at pobox.com>                          http://mml.name/

---

From: [email-masked] (William Morgan)
Date: Fri, 14 Mar 2008 11:30:58 -0700

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

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

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.

> love from gmail.

Yep, you're my target audience. :)

-- 
William <wmorgan-sup at masanjin.net>