File: mh-thread.el.html
The threading portion of this files tries to implement the
algorithm described at:
https://www.jwz.org/doc/threading.html
It also begins to implement the threading section of the IMAP -
SORT and THREAD Extensions RFC at:
https://tools.ietf.org/html/rfc5256
The implementation lacks the reference and subject canonicalization
of the RFC.
In the presentation buffer, children messages are shown indented with either [ ] or < > around them. Square brackets ([ ]) denote that the algorithm can point out some headers which when taken together implies that the unindented message is an ancestor of the indented message. If no such proof exists then angles (< >) are used.
If threading is slow on your machine, compile this file. Of all the files in MH-E, this one really benefits from compilation.
Some issues and problems are as follows:
(1) Scan truncates the fields at length 512. So longer
references: headers get mutilated. The same kind of MH
format string works when composing messages. Is there a way
to avoid this? My scan command is as follows:
scan +folder -width 10000 \
-format "%(msg)\\n%{message-id}\\n%{references}\\n%{subject}\\n"
I would really appreciate it if someone would help me with this.
(2) Implement heuristics to recognize message identifiers in
In-Reply-To: header. Right now it just assumes that the last
text between angles (< and >) is the message identifier.
There is the chance that this will incorrectly use an email
address like a message identifier.
(3) Error checking of found message identifiers should be done.
(4) Since this breaks the assumption that message indices
increase as one goes down the buffer, the binary search
based mh-goto-msg doesn't work. I have a simpler replacement
which may be less efficient.
(5) Better canonicalizing for message identifier and subject strings.
Defined variables (10)
mh-message-id-regexp | Regexp to recognize whether a string is a message identifier. |
mh-thread-body-width | Width of scan substring that contains subject and body of message. |
mh-thread-duplicates | Hash table used to associate messages with the same message identifier. |
mh-thread-history | Variable to remember the transformations to the thread tree. |
mh-thread-id-hash | Hash table used to canonicalize message identifiers. |
mh-thread-id-index-map | Table to look up message index number from message identifier. |
mh-thread-id-table | Thread ID table maps from message identifiers to message containers. |
mh-thread-index-id-map | Table to look up message identifier from message index. |
mh-thread-subject-container-hash | Hash table used to group messages by subject. |
mh-thread-subject-hash | Hash table used to canonicalize subject strings. |