Getting the right root mail of the thread

Jani Nikula jani at nikula.org
Sat Nov 2 06:50:32 PDT 2013


On Sat, 02 Nov 2013, Felipe Contreras <felipe.contreras at gmail.com> wrote:
> I often wondered why when browsing threads, I often see a message that doesn't
> describe at all the thread, for example:
>
>   notmuch search ...
>   thread:000000000000826a 18 mins. ago [45/45] Felipe Contreras; [PATCH/TEST 44/44]
>
> I can reverse the order of the search:
>
>   notmuch search --sort=oldest-first
>   thread:000000000000826a 23 mins. ago [45/45] Felipe Contreras; [PATCH/TEST 00/44]
>
> Then I get the correct summary, but now the order of the search is the other
> way around, and there doesn't seem to be a way to specify the order of the
> messages independently of the order of the threads.

I think it's actually worse than what your example demonstrates. It's
the subject of the newest/oldest *matching* message that gets used. In
your example, the first/last messages in the thread apparently match
your query.

> Either way this doesn't make any sense to me. Each thread has a single origin
> mail, why would anybody would like to show a message other than that while
> displaying the summary of the tread? Even more, why isn't there an option to
> fetch that information easily?
>
> I am forced to get the list of messages, and then grab the first one, even
> though it's not efficient, probably unnecessary, and potentiall wrong. For
> example, it's possible that multiple mails arrived at the same time, then how
> am I supposed to display the one that originated the thread?
>
> I think there should be a way to get the root mail of a thread,
> irrespective of the search order.

Largely agreed. It's just that nobody's gotten around to doing this
yet. At the cli level I think the consensus is that the structured
(sexp/json) output format should contain multiple (or all) subjects.


BR,
Jani.


More information about the notmuch mailing list