]> git.notmuchmail.org Git - notmuch/blobdiff - notmuch-show.c
cli: omit excluded messages in results where appropriate.
[notmuch] / notmuch-show.c
index 8c0b925e7ecbd922bada42cd079a2da988eec976..05d51b2716d9abc96815d317253a73abd6e410e1 100644 (file)
@@ -1030,6 +1030,7 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
            fprintf (stderr, "Error: specifying parts is incompatible with mbox output format.\n");
            return 1;
        }
+
        format = &format_mbox;
        break;
     case NOTMUCH_FORMAT_RAW:
@@ -1087,6 +1088,11 @@ notmuch_show_command (void *ctx, unused (int argc), unused (char *argv[]))
        return 1;
     }
 
+    /* if format=mbox then we can not output excluded messages as
+     * there is no way to make the exclude flag available */
+    if (format_sel == NOTMUCH_FORMAT_MBOX)
+       notmuch_query_set_omit_excluded_messages (query, TRUE);
+
     /* If a single message is requested we do not use search_excludes. */
     if (params.part >= 0)
        ret = do_show_single (ctx, query, format, &params);