Subject: [sup-talk] joining threads manually

From: [email-masked] (Eyal Oren)
Date: Wed, 14 Nov 2007 00:12:44 +0900

Hi,

Due to other people's broken email clients, threads are sometimes not properly 
connected (eg. their client doesn't use the in-reply-to header).  Mutt allows 
you to manually join such broken threads by first tagging the child message and
then going to the parent message and pressing '&'. 

Would it be possible to do this in sup? Given a pointer to some places in the 
code, I could try to hack something.

PS: Mutt also allows you to break threads ('#') but for me that's less useful.

 -eyal

---

From: [email-masked] (Michael Gurski)
Date: Tue, 13 Nov 2007 11:42:40 -0500

> PS: Mutt also allows you to break threads ('#') but for me that's less useful.

You must have better-trained people on mailing lists you frequent. :-(
There are several I'm on that have subscribers that keep believing
that "reply" means "start a completely new, distinct, unrelated
topic".  Which was fine back in the pine days and no one really
threading anything.  These days, it's...painful.

If no one else wants to tackle either of these, I could probably give
it a shot at some point.  No promises though, as I never seem to have
that "time" thing that I keep hearing about.

-- 
Michael A. Gurski (opt. [first].)[last]@pobox.com  http://www.pobox.com/~[last]
1024R/39B5BADD PGP: 34 93 A9 94 B1 59 48 B7  17 57 1E 4E 62 56 45 70
1024D/1166213E GPG: 628F 37A4 62AF 1475 45DB  AD81 ADC9 E606 1166 213E
4096R/C0B4F04B GPG: 5B3E 75D7 43CF CF34 4042  7788 1DCE B5EE C0B4 F04B
Views expressed by the host do not reflect the staff, management or sponsors.

---

From: [email-masked] (William Morgan)
Date: Tue, 13 Nov 2007 09:12:54 -0800

Excerpts from Eyal Oren's message of Tue Nov 13 07:12:44 -0800 2007:
> Due to other people's broken email clients, threads are sometimes not
> properly connected (eg. their client doesn't use the in-reply-to
> header).  Mutt allows you to manually join such broken threads by
> first tagging the child message and then going to the parent message
> and pressing '&'. 

There is an option in config.yaml to also thread by subject, although I
haven't tested it for quite a while. But that has its own problems, so I
leave it off by default. The best solution, of course, is to go to where
those people live and punish them until they switch to a reasonable
email client.

> Would it be possible to do this in sup? Given a pointer to some places
> in the code, I could try to hack something.

Here's what I would try. In thread-index-mode, given n>1 tagged threads,
you simply want to add the message-id of the root message of the
earliest thread to the refs field of the root messages of all other
threads. (You'll have to make refs a r/w attribute of message instead of
r/o.) That will thread them all at the top level, which probably is the
most reasonable thing to do.

Then you'll need to update thread-index-mode's Threadset to handle the
new structure. It might be enough to call ThreadSet#link (which you'll
have to make public). Or you can first delete the messages from the
threadset with #remove, munge the refs as above, and re-add them with
#add_message. This step will require a little experimentation.

Once the threadset's in place, you can call the ThreadIndexMode#update
to regenerate the display.

> PS: Mutt also allows you to break threads ('#') but for me that's less

If you can accomplish the above, then this will be very similar,
although it will belong in thread-view-mode.

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