nmh-workers
[Top] [All Lists]

Re: sorting messages by thread

2002-09-11 08:43:07
Michael Richardson wrote:
Sorting by subject almost accomplishes what you want.

I'd like to sort by sequence actually :-)

Just a reminder to everyone: MH/nmh messages are stored in files, one message per file... so it's reasonably simple to write programs that rearrange the messages in whatever order you want. You also can use "refile -link" to create a temporary folder, or subfolder, with *links* to the messages in the order you want to see them. Using links means that the original folder isn't disturbed; also, the new temporary folder takes basically no disk space.

For instance, Michael's sorting by sequence might look something like this in a Bourne shell script:

for sequence in `mark -list | sed 's/:.*//'`
do
   refile -link $sequence +inbox/sorted
done

then the +inbox/sorted subfolder would have links to (if I got that right; I haven't tested it!) all the messages from the first sequence followed by all messages from the second sequence, and so on.

This beats sorting in traditional mail agents because they have to parse and rearrange a big file full of all the messages in a folder. Maybe this is obvious to most people on this list, but I thought I should point it out in case it helps.

Jerry
--
Jerry Peek, jpeek(_at_)jpeek(_dot_)com, http://www.jpeek.com/


<Prev in Thread] Current Thread [Next in Thread>