Subject: [sup-talk] Feature Request: Collecting Lines in Index Mode

From: [email-masked] (Christian Dietrich)
Date: Tue, 29 Sep 2009 20:14:58 +0200

Hey there,
i am using sup now for just a few weeks and it is just amazing how
good it works (the lack of folders iritated me a little bit at
first).

But now to my Request, i would like to have something like datelines
in index mode, like:

,-----------------
| -- Today
| 12:23 ...
| 23:42 ...
| -- Yesterday
| Yest. 9 ....
| Yest. 4....
| -- Last week
| .....
.---------------

I think this would cause an bigger overview over the mails,
especially in the inbox.

I tried to implement the feature by my self, but the mapping
beetween `curpos' and `@threads' in modes/thread-index-mode.rb made this
a little bit hard, and i didn't know how to solve this problem
without breaking sup. Perhaps you can give me a hint, how this
problem with the direct mapping can be solved.

greetz didi
-- 
No documentation is better than bad documentation
-- Das Ausdrucken dieser Mail wird urheberrechtlich verfolgt.

---

From: [email-masked] (William Morgan)
Date: Wed, 30 Sep 2009 11:17:55 -0700

> good it works (the lack of folders iritated me a little bit at

Welcome!

> But now to my Request, i would like to have something like datelines

Cool idea. I'd like to see how this looks.

> I tried to implement the feature by my self, but the mapping beetween
> `curpos' and `@threads' in modes/thread-index-mode.rb made this a
> little bit hard, and i didn't know how to solve this problem without
> breaking sup. Perhaps you can give me a hint, how this problem with
> the direct mapping can be solved.

If you look at #regen_text, @text and @lines are the two variables that
control the display. @text is an array of the GUI elements for each line
of the display. Right now it's just set to one line for each thread. You
want to add one additional element at the appropriate position. for each
date line. GUI elements are represented as arrays of [color, text]
pairs; you can look at #text_for_thread_at for an example.

Then, you want to make sure that @lines is set correctly. @lines is a
map (hash) from line number to thread (so that when the user presses a
key, we know which thread the cursor is resting on).

Hope that helps.
-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (Christian Dietrich)
Date: Fri, 02 Oct 2009 22:48:24 +0200

> key, we know which thread the cursor is resting on).

Thank you, that helped a much. I implemented the feature, it is
available at git://github.com/stettberger/sup-mail.git
branch time_marks, it is one commit ahead of next. It is enabled
with setting the config option ":time_markers_in_index_mode: true"
At runtime it can be toggled via '%' (just randomly choosen by me)

greetz didi