On Sat, 21 Nov 2009 21:18:34 -0500, Bart Trojanowski <bart@jukie.net> wrote: > In mutt it looked like this: > > [notmuch] [PATCH 1/3] Make mouse-1 click in search view show thread > └─>[notmuch] [PATCH 2/3] Add 'notmuch count' command to show the count of matching messages > └─>[notmuch] [PATCH 3/3] Add notmuch-index mode to display message counts > > ... and in the mutt threaded display the relationship between the three > messages is pretty clear. > > Now consider what happens when I run notmuch search 'notmuch count'. I > get this: > > Today 02:15 [2/3] Keith Packard; [notmuch] [PATCH 1/3] Make mouse-1 > click in search view show thread (inbox unread) Hmm... that's a bug. What notmuch *should* be doing here is taking as the subject of the thread the subject of the first message in the thread that matched, (rather than the subject of the first message in the thread). The thread_create has all that information, (it constructs two lists---one of all its messages, and one of matched messages). Now the next step is still missing. Let's say that instead of 2/3 mesages matched in the thread, (and by the way, did you all now that that's what's being reported there? it's not the number of unread messages or anything like that, but the number of matched messages). Anyway, let's say you had something like 1/20 there instead. And let's also assume that there aren't any unread messages in the thread. Then when you go to view that thread you will see all the messages open, and you won't have any information as to which message matched. What *should* happen here is that only the messages that matched should be open, and the messages that didn't match should be closed. Currently, the various pieces of the system don't have access to the information they need for this result. One way to do it would be to make "notmuch search" return a list of message IDs rather than a thread ID and then emacs could pass that list to "notmuch show". Alternately, the emacs interface could pass the current thread ID to "notmuch show" but also pass along the search string and then "notmuch show" could indicate which messages matched the search. Another thing to decide is how this relates with the default behavior of opening unread messages but closing read messages. Would possibility there could be to make that work just like any other search, just as I described above. If we were to go that route, I think it might mean getting rid of the distinction between "inbox" and "unread", and I'm not sure I want to do that or not. Anyway, I'd love to hear some ideas. > On a related note, one mail related pet peeve I have is when people > reply to a random email in their mailbox when they actually intend to > start a new thread. Doing that would totally mess up someone using > notmuch. They could get search results with threads which have no > relevance to their actual search... at least at first glance. Hopefully, the fix of displaying the subject from the first matched message would help here. -Carl