]> git.notmuchmail.org Git - notmuch/commitdiff
notmuch-show: identify which messages printed matched the query string
authorBart Trojanowski <bart@jukie.net>
Wed, 25 Nov 2009 04:34:15 +0000 (23:34 -0500)
committerBart Trojanowski <bart@jukie.net>
Wed, 25 Nov 2009 05:46:44 +0000 (00:46 -0500)
The show command outputs all messages in the threads that match the
search-terms.  This patch introduces a 'match:[01]' entry to the 'message{'
line output by the show command.  Value of 1 indicates that the message is
matching the search expression.

Signed-off-by: Bart Trojanowski <bart@jukie.net>
notmuch-show.c

index edebacaa571a3ba44a089fa671300e71f8c530cb..f189e943488e69b7397a61c87e23ca4a4aaa06fe 100644 (file)
@@ -155,9 +155,10 @@ show_message (void *ctx, notmuch_message_t *message, int indent)
     const char *name, *value;
     unsigned int i;
 
-    printf ("\fmessage{ id:%s depth:%d filename:%s\n",
+    printf ("\fmessage{ id:%s depth:%d match:%d filename:%s\n",
            notmuch_message_get_message_id (message),
            indent,
+           notmuch_message_get_flag (message, NOTMUCH_MSG_FLAG_MATCHING_SEARCH),
            notmuch_message_get_filename (message));
 
     printf ("\fheader{\n");