From c168e24174d32563ceb1a35d9bf1875c5bfeac25 Mon Sep 17 00:00:00 2001 From: Carl Worth Date: Thu, 12 Nov 2009 22:01:44 -0800 Subject: notmuch search: Print the number of matched/total messages for each thread. Note that we don't print the number of *unread* messages, but instead the number of messages that matched the search terms. This is in keeping with our philosophy that the inbox is nothing more than a search view. If we search for messages with an inbox tag, then that's what we'll get a count of. (And if somebody does want to see unread counts, then they can search for the "unread" tag.) Getting the number of matched messages is really nice when doing historical searches. For example in a search like: notmuch search tag:sent (where the "sent" tag has been applied to all messages originating from the user's email address)---here it's really nice to be able to see a thread where the user just mentioned one point [1/13] vs. really getting involved in the discussion [10/29]. --- notmuch-search.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'notmuch-search.c') diff --git a/notmuch-search.c b/notmuch-search.c index 85f3514e..a0a71bbd 100644 --- a/notmuch-search.c +++ b/notmuch-search.c @@ -91,9 +91,11 @@ notmuch_search_command (void *ctx, int argc, char *argv[]) date = notmuch_thread_get_oldest_date (thread); relative_date = notmuch_time_relative_date (ctx, date); - printf ("thread:%s %12s %s; %s", + printf ("thread:%s %12s [%d/%d] %s; %s", notmuch_thread_get_thread_id (thread), relative_date, + notmuch_thread_get_matched_messages (thread), + notmuch_thread_get_total_messages (thread), notmuch_thread_get_authors (thread), notmuch_thread_get_subject (thread)); -- cgit v1.2.3