--- /dev/null
+Return-Path: <sojka@merica.cz>\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 16903431FAE\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Nov 2014 12:15:38 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.224\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.224 tagged_above=-999 required=5\r
+ tests=[DATE_IN_PAST_03_06=1.076, RCVD_IN_DNSWL_MED=-2.3]\r
+ 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 pV09gCfaBywZ for <notmuch@notmuchmail.org>;\r
+ Tue, 4 Nov 2014 12:15:30 -0800 (PST)\r
+X-Greylist: delayed 300 seconds by postgrey-1.32 at olra;\r
+ Tue, 04 Nov 2014 12:15:29 PST\r
+Received: from relay.felk.cvut.cz (relay.felk.cvut.cz [147.32.80.7])\r
+ by olra.theworths.org (Postfix) with ESMTP id CB225431FB6\r
+ for <notmuch@notmuchmail.org>; Tue, 4 Nov 2014 12:15:29 -0800 (PST)\r
+Received: from control.felk.cvut.cz (control.felk.cvut.cz [147.32.87.4])\r
+ by relay.felk.cvut.cz (8.14.9/8.14.9) with ESMTP id sA4FZxMn036846;\r
+ Tue, 4 Nov 2014 16:36:00 +0100 (CET) (envelope-from sojka@merica.cz)\r
+Received: from CONTROL/SpoolDir by control.felk.cvut.cz (Mercury 1.48);\r
+ 4 Nov 14 16:36:01 +0100\r
+Received: from SpoolDir by CONTROL (Mercury 1.48); 4 Nov 14 16:35:54 +0100\r
+Received: from rtime.felk.cvut.cz (147.32.86.92) by control.felk.cvut.cz\r
+ (Mercury 1.48) with ESMTP; 4 Nov 14 16:35:53 +0100\r
+Received: from localhost ([127.0.0.1] helo=steelpick.2x.cz)\r
+ by rtime.felk.cvut.cz with esmtp (Exim 4.80)\r
+ (envelope-from <sojka@merica.cz>)\r
+ id 1Xlg9A-0004xd-Vm; Tue, 04 Nov 2014 16:35:53 +0100\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
+ (envelope-from <sojka@merica.cz>)\r
+ id 1XlcFO-0002OM-St; Tue, 04 Nov 2014 12:26:02 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v2 07/10] cli: search: Convert --output to keyword\r
+ argument\r
+In-Reply-To: <87389z4a1g.fsf@qmul.ac.uk>\r
+References: <1415058622-21162-1-git-send-email-sojkam1@fel.cvut.cz>\r
+ <1415058622-21162-8-git-send-email-sojkam1@fel.cvut.cz>\r
+ <87389z4a1g.fsf@qmul.ac.uk>\r
+User-Agent: Notmuch/0.18.2+157~ga00d359 (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Tue, 04 Nov 2014 12:26:02 +0100\r
+Message-ID: <87d293mcl1.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\r
+X-FELK-MailScanner-Information: \r
+X-MailScanner-ID: sA4FZxMn036846\r
+X-FELK-MailScanner: Found to be clean\r
+X-FELK-MailScanner-SpamCheck: not spam, SpamAssassin (not cached,\r
+ score=1.093, required 6, BAYES_00 -0.50, DATE_IN_PAST_03_06 1.59,\r
+ HEADER_FROM_DIFFERENT_DOMAINS 0.00)\r
+X-FELK-MailScanner-SpamScore: s\r
+X-FELK-MailScanner-From: sojka@merica.cz\r
+X-FELK-MailScanner-Watermark: 1415720167.13071@8ULxbe+NOiHFa8Z1Yt4Azg\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: Tue, 04 Nov 2014 20:15:38 -0000\r
+\r
+On Tue, Nov 04 2014, Mark Walters wrote:\r
+> Hi\r
+>\r
+> On Mon, 03 Nov 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+>> Now, when address related outputs are in a separate command, it makes\r
+>> no sense to combine multiple --output options in search command line.\r
+>> Using switch statement to handle different outputs is more readable\r
+>> than a series of if statements.\r
+>\r
+> I am not keen on this change: I think the user should always be able to\r
+> force the default output by setting command line options (which should\r
+> protect against future changes in the default). \r
+\r
+You can do this even with this patch.\r
+\r
+> Thus I would like to continue to allow --output=sender\r
+> --output=recipients.\r
+\r
+This is allowed in notmuch address. This patch modifies only notmuch\r
+search. Currently it makes no sense to run --output=files --output=tags\r
+or other output combinations.\r
+\r
+> I do approve of making the default do something useful but whether it\r
+> should be both or just sender (which is much faster) is unclear to me.\r
+\r
+Does this comment refer to 7/10 or to 6/10?\r
+\r
+I'd say it refers to the following line from 6/10.\r
+\r
+search_context.output = OUTPUT_SENDER | OUTPUT_RECIPIENTS;\r
+\r
+Even there you can override the default by command line option. This get\r
+executed only if no --output appears on the command line.\r
+\r
+Thanks\r
+-Michal\r
+\r
+\r
+>\r
+> Best wishes\r
+>\r
+> Mark\r
+>\r
+> \r
+>> ---\r
+>> doc/man1/notmuch-search.rst | 3 ---\r
+>> notmuch-search.c | 25 +++++++++++++------------\r
+>> 2 files changed, 13 insertions(+), 15 deletions(-)\r
+>>\r
+>> diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst\r
+>> index 65df288..0cc2911 100644\r
+>> --- a/doc/man1/notmuch-search.rst\r
+>> +++ b/doc/man1/notmuch-search.rst\r
+>> @@ -78,9 +78,6 @@ Supported options for **search** include\r
+>> by null characters (--format=text0), as a JSON array\r
+>> (--format=json), or as an S-Expression list (--format=sexp).\r
+>> \r
+>> - This option can be given multiple times to combine different\r
+>> - outputs.\r
+>> -\r
+>> ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)\r
+>> This option can be used to present results in either\r
+>> chronological order (**oldest-first**) or reverse chronological\r
+>> diff --git a/notmuch-search.c b/notmuch-search.c\r
+>> index cbd84f5..402e860 100644\r
+>> --- a/notmuch-search.c\r
+>> +++ b/notmuch-search.c\r
+>> @@ -593,7 +593,7 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+>> int opt_index, ret;\r
+>> \r
+>> notmuch_opt_desc_t options[] = {\r
+>> - { NOTMUCH_OPT_KEYWORD_FLAGS, &ctx->output, "output", 'o',\r
+>> + { NOTMUCH_OPT_KEYWORD, &ctx->output, "output", 'o',\r
+>> (notmuch_keyword_t []){ { "summary", OUTPUT_SUMMARY },\r
+>> { "threads", OUTPUT_THREADS },\r
+>> { "messages", OUTPUT_MESSAGES },\r
+>> @@ -607,13 +607,11 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+>> { 0, 0, 0, 0, 0 }\r
+>> };\r
+>> \r
+>> + ctx->output = OUTPUT_SUMMARY;\r
+>> opt_index = parse_arguments (argc, argv, options, 1);\r
+>> if (opt_index < 0)\r
+>> return EXIT_FAILURE;\r
+>> \r
+>> - if (! ctx->output)\r
+>> - ctx->output = OUTPUT_SUMMARY;\r
+>> -\r
+>> if (ctx->output != OUTPUT_FILES && ctx->output != OUTPUT_MESSAGES &&\r
+>> ctx->dupe != -1) {\r
+>> fprintf (stderr, "Error: --duplicate=N is only supported with --output=files and --output=messages.\n");\r
+>> @@ -624,17 +622,20 @@ notmuch_search_command (notmuch_config_t *config, int argc, char *argv[])\r
+>> argc - opt_index, argv + opt_index))\r
+>> return EXIT_FAILURE;\r
+>> \r
+>> - if (ctx->output == OUTPUT_SUMMARY ||\r
+>> - ctx->output == OUTPUT_THREADS)\r
+>> + switch (ctx->output) {\r
+>> + case OUTPUT_SUMMARY:\r
+>> + case OUTPUT_THREADS:\r
+>> ret = do_search_threads (ctx);\r
+>> - else if (ctx->output == OUTPUT_MESSAGES ||\r
+>> - ctx->output == OUTPUT_FILES)\r
+>> + break;\r
+>> + case OUTPUT_MESSAGES:\r
+>> + case OUTPUT_FILES:\r
+>> ret = do_search_messages (ctx);\r
+>> - else if (ctx->output == OUTPUT_TAGS)\r
+>> + break;\r
+>> + case OUTPUT_TAGS:\r
+>> ret = do_search_tags (ctx);\r
+>> - else {\r
+>> - fprintf (stderr, "Error: the combination of outputs is not supported.\n");\r
+>> - ret = 1;\r
+>> + break;\r
+>> + default:\r
+>> + INTERNAL_ERROR ("Unexpected output");\r
+>> }\r
+>> \r
+>> _notmuch_search_cleanup (ctx);\r
+>> -- \r
+>> 2.1.1\r
+>>\r
+>> _______________________________________________\r
+>> notmuch mailing list\r
+>> notmuch@notmuchmail.org\r
+>> http://notmuchmail.org/mailman/listinfo/notmuch\r