--- /dev/null
+Return-Path: <amdragon@mit.edu>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by olra.theworths.org (Postfix) with ESMTP id E8AFD431FB6\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Apr 2012 18:18:19 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.7\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
+ tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+ by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id NykhzrfukBUF for <notmuch@notmuchmail.org>;\r
+ Thu, 5 Apr 2012 18:18:19 -0700 (PDT)\r
+Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
+ [18.9.25.14])\r
+ by olra.theworths.org (Postfix) with ESMTP id 102A7431FAE\r
+ for <notmuch@notmuchmail.org>; Thu, 5 Apr 2012 18:18:18 -0700 (PDT)\r
+X-AuditID: 1209190e-b7f7c6d0000008c3-e3-4f7e4459f9ac\r
+Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
+ by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
+ id AC.99.02243.9544E7F4; Thu, 5 Apr 2012 21:18:17 -0400 (EDT)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+ by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q361IGTW007494; \r
+ Thu, 5 Apr 2012 21:18:17 -0400\r
+Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91])\r
+ (authenticated bits=0)\r
+ (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+ by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q361IFgH014638\r
+ (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+ Thu, 5 Apr 2012 21:18:16 -0400 (EDT)\r
+Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77)\r
+ (envelope-from <amdragon@mit.edu>)\r
+ id 1SFxod-0004QO-J9; Thu, 05 Apr 2012 21:18:15 -0400\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 3/6] cli: move search to the new --exclude= naming\r
+ scheme.\r
+In-Reply-To: <1333234442-28616-4-git-send-email-markwalters1009@gmail.com>\r
+References: <1333234442-28616-1-git-send-email-markwalters1009@gmail.com>\r
+ <1333234442-28616-4-git-send-email-markwalters1009@gmail.com>User-Agent:\r
+ Notmuch/0.11.1+358~g3b96caf (http://notmuchmail.org)\r
+ Emacs/23.3.1 (i486-pc-linux-gnu)\r
+Date: Thu, 05 Apr 2012 21:18:15 -0400\r
+Message-ID: <87398hd5ew.fsf@awakening.csail.mit.edu>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFnrEIsWRmVeSWpSXmKPExsUixG6nohvpUudvMHeBtsXquTwW12/OZHZg\r
+ 8tg56y67x7NVt5gDmKK4bFJSczLLUov07RK4Mr5OXslecFG3YvPxZvYGxi9KXYycHBICJhJT\r
+ V09igbDFJC7cW8/WxcjFISSwj1Hixq6LjBDOekaJtedXskM4J5gkVp/4xQLhLGGU6Ly1ih2k\r
+ n01AQ2Lb/uWMILaIgKvE02+fmUFsYYFAidZ7p8HinAJeEv/3n2CCaH7BKNF9qgVsOYuAqsTV\r
+ tgVgRbxARz2b/4EZwhaUODnzCVgNs4CWxI1/L5kmMPLPQpKahSS1gJFpFaNsSm6Vbm5iZk5x\r
+ arJucXJiXl5qka6xXm5miV5qSukmRlDwcUry7WD8elDpEKMAB6MSD2/x5lp/IdbEsuLK3EOM\r
+ khxMSqK8bA51/kJ8SfkplRmJxRnxRaU5qcWHGCU4mJVEeJ/yA+V4UxIrq1KL8mFS0hwsSuK8\r
+ alrv/IQE0hNLUrNTUwtSi2CyMhwcShK8oc5AjYJFqempFWmZOSUIaSYOTpDhPEDDG0BqeIsL\r
+ EnOLM9Mh8qcYdTmeH+q9wijEkpeflyolztsJUiQAUpRRmgc3B5Y0XjGKA70lzLsCpIoHmHDg\r
+ Jr0CWsIEtOTk12qQJSWJCCmpBsZEKetXu5um7boqas+p5urtpFu0R87pXV7AKa7snABW7aZp\r
+ tZVLWAXzngh26/Oet/1z5e6esIuvD2zZfvdH/+lw2093ylc9W7/RhkHqW2XorAalwDw7fv/T\r
+ Va7/57jz5JwRD569vXnX9argtvgk+wU2JdWyQbWO/wJUN4VdymphOjBT4/3SbUosxRmJhlrM\r
+ RcWJAJ/n+H31AgAA\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 06 Apr 2012 01:18:20 -0000\r
+\r
+On Sat, 31 Mar 2012, Mark Walters <markwalters1009@gmail.com> wrote:\r
+> This commit replaces the --no-exclude option with a\r
+> --exclude=(true|false|flag) option. The default is to omit the\r
+> excluded messages.\r
+>\r
+> The flag option only makes sense if output=summary (as otherwise there\r
+> is nowhere to print the flag). In summary output exclude=false and\r
+> exclude=flag give almost identical output:\r
+> they differ in that with the exclude=flag option the match count\r
+> (i.e., the x in [x/n] in the output) is the number of matching\r
+> non-excluded messages rather than the number of matching messages.\r
+>\r
+> Note this changes the default for output=summary when no --exclude=\r
+> option is given: it used to default to flag and now defaults to true\r
+> (i.e. omit excluded messages). This is neccesary to keep the cli\r
+> output uncluttered and for speed reasons.\r
+> ---\r
+> man/man1/notmuch-search.1 | 12 +++++++++---\r
+> notmuch-search.c | 32 +++++++++++++++++++++++---------\r
+> 2 files changed, 32 insertions(+), 12 deletions(-)\r
+>\r
+> diff --git a/man/man1/notmuch-search.1 b/man/man1/notmuch-search.1\r
+> index 06d81a6..ebb61fc 100644\r
+> --- a/man/man1/notmuch-search.1\r
+> +++ b/man/man1/notmuch-search.1\r
+> @@ -114,9 +114,15 @@ Limit the number of displayed results to N.\r
+> \r
+> .RS 4\r
+> .TP 4\r
+> -.BR \-\-no\-exclude\r
+> -\r
+> -Do not exclude the messages matching search.exclude_tags in the config file.\r
+> +.BR \-\-exclude=(true|false|flag)\r
+> +\r
+> +Specify whether to omit messages matching search.tag_exclude from the\r
+> +search results (the default) or not. The extra option\r
+> +.B flag\r
+> +only has an effect when\r
+> +.B --output=summary\r
+> +In this case all matching threads are returned but the "match count"\r
+> +is the number of matching non-excluded messages in the thread.\r
+> .RE\r
+> \r
+> .SH SEE ALSO\r
+> diff --git a/notmuch-search.c b/notmuch-search.c\r
+> index f6061e4..fe18a93 100644\r
+> --- a/notmuch-search.c\r
+> +++ b/notmuch-search.c\r
+> @@ -210,9 +210,6 @@ do_search_threads (const search_format_t *format,\r
+> int first_thread = 1;\r
+> int i;\r
+> \r
+> - if (output == OUTPUT_THREADS)\r
+> - notmuch_query_set_omit_excluded_messages (query, TRUE);\r
+> -\r
+> if (offset < 0) {\r
+> offset += notmuch_query_count_threads (query);\r
+> if (offset < 0)\r
+> @@ -303,8 +300,6 @@ do_search_messages (const search_format_t *format,\r
+> int first_message = 1;\r
+> int i;\r
+> \r
+> - notmuch_query_set_omit_excluded_messages (query, TRUE);\r
+> -\r
+> if (offset < 0) {\r
+> offset += notmuch_query_count_messages (query);\r
+> if (offset < 0)\r
+> @@ -376,7 +371,6 @@ do_search_tags (notmuch_database_t *notmuch,\r
+> const char *tag;\r
+> int first_tag = 1;\r
+> \r
+> - notmuch_query_set_omit_excluded_messages (query, TRUE);\r
+> /* should the following only special case if no excluded terms\r
+> * specified? */\r
+> \r
+> @@ -422,6 +416,12 @@ do_search_tags (notmuch_database_t *notmuch,\r
+> return 0;\r
+> }\r
+> \r
+> +enum {\r
+> + EXCLUDE_TRUE,\r
+> + EXCLUDE_FALSE,\r
+> + EXCLUDE_FLAG,\r
+> +};\r
+> +\r
+> int\r
+> notmuch_search_command (void *ctx, int argc, char *argv[])\r
+> {\r
+> @@ -435,7 +435,7 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+> output_t output = OUTPUT_SUMMARY;\r
+> int offset = 0;\r
+> int limit = -1; /* unlimited */\r
+> - notmuch_bool_t no_exclude = FALSE;\r
+> + int exclude = EXCLUDE_TRUE;\r
+> unsigned int i;\r
+> \r
+> enum { NOTMUCH_FORMAT_JSON, NOTMUCH_FORMAT_TEXT }\r
+> @@ -457,7 +457,11 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+> { "files", OUTPUT_FILES },\r
+> { "tags", OUTPUT_TAGS },\r
+> { 0, 0 } } },\r
+> - { NOTMUCH_OPT_BOOLEAN, &no_exclude, "no-exclude", 'd', 0 },\r
+> + { NOTMUCH_OPT_KEYWORD, &exclude, "exclude", 'x',\r
+> + (notmuch_keyword_t []){ { "true", EXCLUDE_TRUE },\r
+> + { "false", EXCLUDE_FALSE },\r
+> + { "flag", EXCLUDE_FLAG },\r
+> + { 0, 0 } } },\r
+> { NOTMUCH_OPT_INT, &offset, "offset", 'O', 0 },\r
+> { NOTMUCH_OPT_INT, &limit, "limit", 'L', 0 },\r
+> { 0, 0, 0, 0, 0 }\r
+> @@ -505,7 +509,15 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+> \r
+> notmuch_query_set_sort (query, sort);\r
+> \r
+> - if (!no_exclude) {\r
+> + if (exclude == EXCLUDE_FLAG && output != OUTPUT_SUMMARY) {\r
+> + /* if we are not doing summary output there is no where to\r
+\r
+s/no where/nowhere/. Also, s/if/If/ for style consistency.\r
+\r
+> + * print the excluded flag so fall back on including the\r
+> + * excluded messages */\r
+> + fprintf (stderr, "Cannot flag excluded messages with this output: fall back on just including them\n");\r
+\r
+I commented on the equivalent of this message in the last version of the\r
+show patch (and now that code is gone anyway), but must have missed it\r
+here. How about just "Warning: this output format cannot flag excluded\r
+messages"? Flag already implies including them, so all you're not doing\r
+in this case is flagging them.\r
+\r
+> + exclude = EXCLUDE_FALSE;\r
+> + }\r
+> +\r
+> + if (exclude == EXCLUDE_TRUE || exclude == EXCLUDE_FLAG) {\r
+> const char **search_exclude_tags;\r
+> size_t search_exclude_tags_length;\r
+> \r
+> @@ -513,6 +525,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
+> (config, &search_exclude_tags_length);\r
+> for (i = 0; i < search_exclude_tags_length; i++)\r
+> notmuch_query_add_tag_exclude (query, search_exclude_tags[i]);\r
+> + if (exclude == EXCLUDE_FLAG)\r
+> + notmuch_query_set_omit_excluded_messages (query, FALSE);\r
+> }\r
+> \r
+> switch (output) {\r
+> -- \r
+> 1.7.9.1\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r