From fa9a5826e908ef73c8b5d31adaa6dbce0c682d2c Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 11 May 2013 20:50:03 +0100 Subject: [PATCH] [PATCH v2 2/8] cli: add --exclude=all option to notmuch-search.c --- 88/1f9018a9be6b9c38040c3f9a11028f37bd23b8 | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 88/1f9018a9be6b9c38040c3f9a11028f37bd23b8 diff --git a/88/1f9018a9be6b9c38040c3f9a11028f37bd23b8 b/88/1f9018a9be6b9c38040c3f9a11028f37bd23b8 new file mode 100644 index 000000000..831b14038 --- /dev/null +++ b/88/1f9018a9be6b9c38040c3f9a11028f37bd23b8 @@ -0,0 +1,111 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 0039D431FD5 + for ; Sat, 11 May 2013 12:50:28 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id P1Tq12kgE2C1 for ; + Sat, 11 May 2013 12:50:23 -0700 (PDT) +Received: from mail-wg0-f44.google.com (mail-wg0-f44.google.com + [74.125.82.44]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 21A75431FBC for ; Sat, 11 May 2013 12:50:21 -0700 + (PDT) +Received: by mail-wg0-f44.google.com with SMTP id z12so4950818wgg.11 + for ; Sat, 11 May 2013 12:50:20 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to + :references; bh=22JM8A7ircSZ6EsHek91NkeZwzH8cR7weUfz92K7r44=; + b=k55nM2RPssUBTTujqAlW2DN5dL2VaYXNSF57Ya+o7Domp/YxpKmGyaufigocXoYrJ2 + wNwq3yy7FR9eflsfgSCZJ/buxtFPDKumczVQ37gH2ZkJZSGvS0IIM//no6LIsYnh2C4C + wZhydmXlWzHjQC8m5taeegHKHJ8xdRCIokbf9+ZbCrSl4G6Qs9nEo6x2JyRkXsihPm1B + xZ9ZTX8o656ga8+zqdUmRwivv4IvHiaIfHtyf1HB49zZQUwK1a9qTMSFiDzhk9zW8TE1 + ZaX8qUn6U+udDVdrL2OMsN++52AnYpSV/JA2485pUCDEZARQQkyFi7uBnfqw5PpE+04K + oNeg== +X-Received: by 10.180.88.231 with SMTP id bj7mr10360757wib.5.1368301820090; + Sat, 11 May 2013 12:50:20 -0700 (PDT) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id q13sm6183188wie.8.2013.05.11.12.50.19 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 11 May 2013 12:50:19 -0700 (PDT) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH v2 2/8] cli: add --exclude=all option to notmuch-search.c +Date: Sat, 11 May 2013 20:50:03 +0100 +Message-Id: <1368301809-12532-3-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1368301809-12532-1-git-send-email-markwalters1009@gmail.com> +References: <1368301809-12532-1-git-send-email-markwalters1009@gmail.com> +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Sat, 11 May 2013 19:50:29 -0000 + +Add a --exclude=all option to notmuch search. +--- + notmuch-search.c | 8 ++++++-- + 1 files changed, 6 insertions(+), 2 deletions(-) + +diff --git a/notmuch-search.c b/notmuch-search.c +index e658639..4323201 100644 +--- a/notmuch-search.c ++++ b/notmuch-search.c +@@ -287,6 +287,7 @@ enum { + EXCLUDE_TRUE, + EXCLUDE_FALSE, + EXCLUDE_FLAG, ++ EXCLUDE_ALL + }; + + int +@@ -334,6 +335,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) + (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE }, + { "false", EXCLUDE_FALSE }, + { "flag", EXCLUDE_FLAG }, ++ { "all", EXCLUDE_ALL }, + { 0, 0 } } }, + { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 }, + { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 }, +@@ -400,7 +402,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) + exclude = EXCLUDE_FALSE; + } + +- if (exclude == EXCLUDE_TRUE || exclude == EXCLUDE_FLAG) { ++ if (exclude != EXCLUDE_FALSE) { + const char **search_exclude_tags; + size_t search_exclude_tags_length; + +@@ -409,7 +411,9 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[]) + for (i = 0; i < search_exclude_tags_length; i++) + notmuch_query_add_tag_exclude (query, search_exclude_tags[i]); + if (exclude == EXCLUDE_FLAG) +- notmuch_query_set_omit_excluded (query, FALSE); ++ notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_FALSE); ++ if (exclude == EXCLUDE_ALL) ++ notmuch_query_set_omit_excluded (query, NOTMUCH_EXCLUDE_ALL); + } + + switch (output) { +-- +1.7.9.1 + -- 2.26.2