--- /dev/null
+Return-Path: <m.walters@qmul.ac.uk>\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 21C72431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 00:24:42 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.098\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.098 tagged_above=-999 required=5\r
+ tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001,\r
+ NML_ADSP_CUSTOM_MED=1.2, RCVD_IN_DNSWL_MED=-2.3] 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 OHGbSQbaWWtk for <notmuch@notmuchmail.org>;\r
+ Fri, 7 Nov 2014 00:24:33 -0800 (PST)\r
+Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6])\r
+ (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))\r
+ (No client certificate requested)\r
+ by olra.theworths.org (Postfix) with ESMTPS id 06A8B431FAE\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 00:24:32 -0800 (PST)\r
+Received: from smtp.qmul.ac.uk ([138.37.6.40])\r
+ by mail2.qmul.ac.uk with esmtp (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Xmeq1-0003xw-Fw; Fri, 07 Nov 2014 08:24:29 +0000\r
+Received: from 5751dfa2.skybroadband.com ([87.81.223.162] helo=localhost)\r
+ by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.71)\r
+ (envelope-from <m.walters@qmul.ac.uk>)\r
+ id 1Xmeq0-0005ZV-S5; Fri, 07 Nov 2014 08:24:09 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH] cli: notmuch address option defaults update\r
+In-Reply-To: <1415297516-29203-1-git-send-email-tomi.ollila@iki.fi>\r
+References: <1415297516-29203-1-git-send-email-tomi.ollila@iki.fi>\r
+User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Fri, 07 Nov 2014 08:24:08 +0000\r
+Message-ID: <871tpf1krb.fsf@qmul.ac.uk>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-Sender-Host-Address: 87.81.223.162\r
+X-QM-Geographic: According to ripencc,\r
+ this message was delivered by a machine in Britain (UK) (GB).\r
+X-QM-SPAM-Info: Sender has good ham record. :)\r
+X-QM-Body-MD5: 76169b25e71e638a9e6f4cac38d4d3ce (of first 20000 bytes)\r
+X-SpamAssassin-Score: -0.1\r
+X-SpamAssassin-SpamBar: /\r
+X-SpamAssassin-Report: The QM spam filters have analysed this message to\r
+ determine if it is\r
+ spam. We require at least 5.0 points to mark a message as spam.\r
+ This message scored -0.1 points.\r
+ Summary of the scoring: \r
+ * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail\r
+ provider * (markwalters1009[at]gmail.com)\r
+ * -0.1 AWL AWL: From: address is in the auto white-list\r
+X-QM-Scan-Virus: ClamAV says the message is clean\r
+Cc: tomi.ollila@iki.fi\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, 07 Nov 2014 08:24:42 -0000\r
+\r
+\r
+Hi\r
+\r
+On Thu, 06 Nov 2014, Tomi Ollila <tomi.ollila@iki.fi> wrote:\r
+> When no --output option were given, change default to display senders\r
+> only. This is faster and provides useful-enough list of addresses.\r
+>\r
+> When only --count option is given, display senders (in contrary to not\r
+> displaying anything).\r
+>\r
+> Document how --count affects to "sort order" a bit more accurately.\r
+>\r
+> Clean up some whitespace in the documentation.\r
+>\r
+> One test updated to have --output=count without sender nor recipient\r
+> output option.\r
+> ---\r
+>\r
+> Some quick updates to the notmuch address interface which I hope will\r
+> be considered to be included in 0.19 release. As we are in feature freeze\r
+> I hope this gets quick feedback, in any way you desire.\r
+\r
+I have tested it and it basically looks good. (As mentioned\r
+on irc) I am mildly in favour of the change to defaulting to\r
+output=sender that this patch does.\r
+\r
+A couple of comments below. Feel free to ignore.\r
+\r
+> Tomi\r
+>\r
+> doc/man1/notmuch-address.rst | 34 ++++++++++++++++++----------------\r
+> notmuch-search.c | 4 ++--\r
+> test/T095-address.sh | 14 +++++++-------\r
+> 3 files changed, 27 insertions(+), 25 deletions(-)\r
+>\r
+> diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst\r
+> index 359616e0dc5f..034607c434d2 100644\r
+> --- a/doc/man1/notmuch-address.rst\r
+> +++ b/doc/man1/notmuch-address.rst\r
+> @@ -32,28 +32,28 @@ Supported options for **address** include\r
+> ``--output=(sender|recipients|count)``\r
+> \r
+> Controls which information appears in the output. This option\r
+> - can be given multiple times to combine different outputs.\r
+> - Omitting this option is equivalent to\r
+> - --output=sender --output=recipients.\r
+> + can be given multiple times to combine different outputs.\r
+> + Omitting this option is equivalent to --output=sender.\r
+\r
+Perhaps say, "if neither --output=sender nor --output=recipients is\r
+specified then this defaults to --output=sender". (Otherwise the manual\r
+does not specify what happens in --output=count case)\r
+\r
+> - **sender**\r
+> + **sender**\r
+> Output all addresses from the *From* header.\r
+> \r
+> - Note: Searching for **sender** should be much faster than\r
+> - searching for **recipients**, because sender addresses are\r
+> - cached directly in the database whereas other addresses\r
+> - need to be fetched from message files.\r
+> + Note: Searching for **sender** should be much faster than\r
+> + searching for **recipients**, because sender addresses are\r
+> + cached directly in the database whereas other addresses\r
+> + need to be fetched from message files.\r
+> \r
+> - **recipients**\r
+> + **recipients**\r
+> Output all addresses from the *To*, *Cc* and *Bcc*\r
+> headers.\r
+> \r
+> - **count**\r
+> - Print the count of how many times was the address\r
+> - encountered during search.\r
+> + **count**\r
+> + Print the count of how many times was the address\r
+> + encountered during search.\r
+> \r
+> - Note: With this option, addresses are printed only after\r
+> - the whole search is finished. This may take long time.\r
+> + Note: With this option, addresses are printed only after\r
+> + the whole search is finished (and in seemingly random\r
+> + order). This may take long time.\r
+> \r
+> ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)\r
+> This option can be used to present results in either\r
+> @@ -63,7 +63,9 @@ Supported options for **address** include\r
+> By default, results will be displayed in reverse chronological\r
+> order, (that is, the newest results will be displayed first).\r
+> \r
+> - This option has no effect when used with --output=count.\r
+> + This option affects the seemingly random output order when\r
+> + used with --output=count.\r
+\r
+I know what this means but it confused me at first. How about "When\r
+used with --output=count this option changes the output from one\r
+seemingly random order to a different seemingly random order"? \r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+> \r
+> ``--exclude=(true|false)``\r
+> A message is called "excluded" if it matches at least one tag in\r
+> @@ -95,4 +97,4 @@ SEE ALSO\r
+> **notmuch-dump(1)**, **notmuch-hooks(5)**, **notmuch-insert(1)**,\r
+> **notmuch-new(1)**, **notmuch-reply(1)**, **notmuch-restore(1)**,\r
+> **notmuch-search-terms(7)**, **notmuch-show(1)**, **notmuch-tag(1)**,\r
+> -***notmuch-search(1)**\r
+> +**notmuch-search(1)**\r
+> diff --git a/notmuch-search.c b/notmuch-search.c\r
+> index 5036d8e44005..14b9f01c5ad1 100644\r
+> --- a/notmuch-search.c\r
+> +++ b/notmuch-search.c\r
+> @@ -735,8 +735,8 @@ notmuch_address_command (notmuch_config_t *config, int argc, char *argv[])\r
+> if (opt_index < 0)\r
+> return EXIT_FAILURE;\r
+> \r
+> - if (! ctx->output)\r
+> - ctx->output = OUTPUT_SENDER | OUTPUT_RECIPIENTS;\r
+> + if (! (ctx->output & (OUTPUT_SENDER | OUTPUT_RECIPIENTS)))\r
+> + ctx->output |= OUTPUT_SENDER;\r
+> \r
+> if (_notmuch_search_prepare (ctx, config,\r
+> argc - opt_index, argv + opt_index))\r
+> diff --git a/test/T095-address.sh b/test/T095-address.sh\r
+> index 033d0f4fd68c..ed0cac7807ff 100755\r
+> --- a/test/T095-address.sh\r
+> +++ b/test/T095-address.sh\r
+> @@ -27,6 +27,11 @@ Mikhail Gusarov <dottedmag@dottedmag.net>\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+> \r
+> +test_begin_subtest "without --output"\r
+> +notmuch address '*' >OUTPUT\r
+> +# Use EXPECTED from previous subtest\r
+> +test_expect_equal_file OUTPUT EXPECTED\r
+> +\r
+> test_begin_subtest "--output=sender --format=json"\r
+> notmuch address --output=sender --format=json '*' >OUTPUT\r
+> cat <<EOF >EXPECTED\r
+> @@ -91,11 +96,6 @@ Mikhail Gusarov <dottedmag@dottedmag.net>\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+> \r
+> -test_begin_subtest "without --output"\r
+> -notmuch address '*' >OUTPUT\r
+> -# Use EXPECTED from previous subtest\r
+> -test_expect_equal_file OUTPUT EXPECTED\r
+> -\r
+> test_begin_subtest "--output=sender --output=count"\r
+> notmuch address --output=sender --output=count '*' | sort -n >OUTPUT\r
+> cat <<EOF >EXPECTED\r
+> @@ -119,10 +119,10 @@ cat <<EOF >EXPECTED\r
+> EOF\r
+> test_expect_equal_file OUTPUT EXPECTED\r
+> \r
+> -test_begin_subtest "--output=sender --output=count --format=json"\r
+> +test_begin_subtest "--output=count --format=json"\r
+> # Since the iteration order of GHashTable is not specified, we\r
+> # preprocess and sort the results to keep the order stable here.\r
+> -notmuch address --output=sender --output=count --format=json '*' | \\r
+> +notmuch address --output=count --format=json '*' | \\r
+> sed -e 's/^\[//' -e 's/]$//' -e 's/,$//' | sort >OUTPUT\r
+> cat <<EOF >EXPECTED\r
+> {"name": "Adrian Perez de Castro", "address": "aperez@igalia.com", "name-addr": "Adrian Perez de Castro <aperez@igalia.com>", "count": 1}\r
+> -- \r
+> 2.0.0\r
+>\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r