From mboxrd@z Thu Jan 1 00:00:00 1970 From: wmorgan-sup@masanjin.net (William Morgan) Date: Tue, 13 Nov 2007 09:12:54 -0800 Subject: [sup-talk] joining threads manually In-Reply-To: <1194966571-sup-6200@timmy> References: <1194966571-sup-6200@timmy> Message-ID: <1194973525-sup-1660@south> 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 > useful. If you can accomplish the above, then this will be very similar, although it will belong in thread-view-mode. -- William