--- /dev/null
+Return-Path: <too@guru-group.fi>\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 0C34B431FBC\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 10:32:36 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none]\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 xBIxd0LZI6t5 for <notmuch@notmuchmail.org>;\r
+ Fri, 7 Nov 2014 10:32:26 -0800 (PST)\r
+Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34])\r
+ by olra.theworths.org (Postfix) with ESMTP id 9A47D431FB6\r
+ for <notmuch@notmuchmail.org>; Fri, 7 Nov 2014 10:32:26 -0800 (PST)\r
+Received: by guru.guru-group.fi (Postfix, from userid 501)\r
+ id 05C4D10008E; Fri, 7 Nov 2014 20:31:52 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v2] cli: notmuch address option defaults update\r
+Date: Fri, 7 Nov 2014 20:31:50 +0200\r
+Message-Id: <1415385110-2694-1-git-send-email-tomi.ollila@iki.fi>\r
+X-Mailer: git-send-email 2.0.0\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 18:32:36 -0000\r
+\r
+When no --output option were given, change default to display senders\r
+only.\r
+\r
+When only --count option is given, display senders (in contrary to not\r
+displaying anything).\r
+\r
+Document that --count with --sort=**order** is not supported option\r
+combination.\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
+This v2 of id:1415297516-29203-1-git-send-email-tomi.ollila@iki.fi,\r
+and addresses comments to notmuch-address.rst from David & Michal.\r
+Thanks to Mark, too -- for giving me hard time to choose between\r
+his & Michal's suggestion ;D\r
+\r
+Tomi\r
+\r
+ doc/man1/notmuch-address.rst | 32 ++++++++++++++++----------------\r
+ notmuch-search.c | 4 ++--\r
+ test/T095-address.sh | 14 +++++++-------\r
+ 3 files changed, 25 insertions(+), 25 deletions(-)\r
+\r
+diff --git a/doc/man1/notmuch-address.rst b/doc/man1/notmuch-address.rst\r
+index 359616e..9570095 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
++ When neither --output=sender nor --output=recipients is\r
++ given, --output=sender is implied.\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. 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,7 @@ 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 is not supported with --output=count.\r
+ \r
+ ``--exclude=(true|false)``\r
+ A message is called "excluded" if it matches at least one tag in\r
+@@ -95,4 +95,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 5036d8e..14b9f01 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 033d0f4..ed0cac7 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.1.0\r
+\r