--- /dev/null
+Return-Path: <sojkam1@fel.cvut.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 706E4429E27\r
+ for <notmuch@notmuchmail.org>; Sat, 1 Nov 2014 17:54:08 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+ tests=[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 Yk3LWgHdpr4N for <notmuch@notmuchmail.org>;\r
+ Sat, 1 Nov 2014 17:54:03 -0700 (PDT)\r
+Received: from max.feld.cvut.cz (max.feld.cvut.cz [147.32.192.36])\r
+ by olra.theworths.org (Postfix) with ESMTP id 5C125429E26\r
+ for <notmuch@notmuchmail.org>; Sat, 1 Nov 2014 17:54:03 -0700 (PDT)\r
+Received: from localhost (unknown [192.168.200.7])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id B9A6E5CD288;\r
+ Sun, 2 Nov 2014 01:54:02 +0100 (CET)\r
+X-Virus-Scanned: IMAP STYX AMAVIS\r
+Received: from max.feld.cvut.cz ([192.168.200.1])\r
+ by localhost (styx.feld.cvut.cz [192.168.200.7]) (amavisd-new,\r
+ port 10044)\r
+ with ESMTP id ZFiLrnN3PHBq; Sun, 2 Nov 2014 01:53:58 +0100 (CET)\r
+Received: from imap.feld.cvut.cz (imap.feld.cvut.cz [147.32.192.34])\r
+ by max.feld.cvut.cz (Postfix) with ESMTP id 7B1A85CD287;\r
+ Sun, 2 Nov 2014 01:53:57 +0100 (CET)\r
+Received: from wsh by steelpick.2x.cz with local (Exim 4.84)\r
+ (envelope-from <sojkam1@fel.cvut.cz>)\r
+ id 1XkjQb-0008Cc-4b; Sun, 02 Nov 2014 01:53:57 +0100\r
+From: Michal Sojka <sojkam1@fel.cvut.cz>\r
+To: Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v6 6/7] cli: search: Add --output=count\r
+In-Reply-To: <87r3xnu3dn.fsf@qmul.ac.uk>\r
+References: <1414792441-29555-1-git-send-email-sojkam1@fel.cvut.cz>\r
+ <1414792441-29555-7-git-send-email-sojkam1@fel.cvut.cz>\r
+ <87r3xnu3dn.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: Sun, 02 Nov 2014 01:53:57 +0100\r
+Message-ID: <87bnoqbexm.fsf@steelpick.2x.cz>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain\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: Sun, 02 Nov 2014 00:54:08 -0000\r
+\r
+On Sat, Nov 01 2014, Mark Walters wrote:\r
+> On Fri, 31 Oct 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+>> This output can be used with --output=recipients or --output=sender\r
+>> and in addition to the addresses, it prints how many times was each\r
+>> address encountered during search.\r
+>\r
+> Hi\r
+>\r
+> I have a couple comments on this patch.\r
+>\r
+>> ---\r
+>> completion/notmuch-completion.bash | 2 +-\r
+>> completion/notmuch-completion.zsh | 2 +-\r
+>> doc/man1/notmuch-search.rst | 9 +++++--\r
+>> notmuch-search.c | 51 ++++++++++++++++++++++++++++++++------\r
+>> 4 files changed, 52 insertions(+), 12 deletions(-)\r
+>>\r
+>> diff --git a/completion/notmuch-completion.bash b/completion/notmuch-completion.bash\r
+>> index cfbd389..39cd829 100644\r
+>> --- a/completion/notmuch-completion.bash\r
+>> +++ b/completion/notmuch-completion.bash\r
+>> @@ -294,7 +294,7 @@ _notmuch_search()\r
+>> return\r
+>> ;;\r
+>> --output)\r
+>> - COMPREPLY=( $( compgen -W "summary threads messages files tags sender recipients" -- "${cur}" ) )\r
+>> + COMPREPLY=( $( compgen -W "summary threads messages files tags sender recipients count" -- "${cur}" ) )\r
+>> return\r
+>> ;;\r
+>> --sort)\r
+>> diff --git a/completion/notmuch-completion.zsh b/completion/notmuch-completion.zsh\r
+>> index 3e52a00..d7e5a5e 100644\r
+>> --- a/completion/notmuch-completion.zsh\r
+>> +++ b/completion/notmuch-completion.zsh\r
+>> @@ -53,7 +53,7 @@ _notmuch_search()\r
+>> '--max-threads=[display only the first x threads from the search results]:number of threads to show: ' \\r
+>> '--first=[omit the first x threads from the search results]:number of threads to omit: ' \\r
+>> '--sort=[sort results]:sorting:((newest-first\:"reverse chronological order" oldest-first\:"chronological order"))' \\r
+>> - '--output=[select what to output]:output:((summary threads messages files tags sender recipients))'\r
+>> + '--output=[select what to output]:output:((summary threads messages files tags sender recipients count))'\r
+>> }\r
+>> \r
+>> _notmuch()\r
+>> diff --git a/doc/man1/notmuch-search.rst b/doc/man1/notmuch-search.rst\r
+>> index 42f17e4..ec89200 100644\r
+>> --- a/doc/man1/notmuch-search.rst\r
+>> +++ b/doc/man1/notmuch-search.rst\r
+>> @@ -96,9 +96,14 @@ Supported options for **search** include\r
+>> Like **sender** but for addresses from *To*, *Cc* and\r
+>> *Bcc* headers.\r
+>> \r
+>> + **count**\r
+>> + Can be used in combination with **sender** or\r
+>> + **recipients** to print the count of how many times was\r
+>> + the address encountered during search.\r
+>> +\r
+>> This option can be given multiple times to combine different\r
+>> - outputs. Currently, this is only supported for **sender** and\r
+>> - **recipients** outputs.\r
+>> + outputs. Currently, this is only supported for **sender**,\r
+>> + **recipients** and **count** outputs.\r
+>\r
+> It might be worth saying that the results will be slower if count is\r
+> specified.\r
+\r
+I wrote something like this in\r
+id:1414889400-30977-10-git-send-email-sojkam1@fel.cvut.cz.\r
+\r
+>\r
+>> ``--sort=``\ (**newest-first**\ \|\ **oldest-first**)\r
+>\r
+> I think sort works as expected if count is not specified, but does not\r
+> with count. \r
+\r
+Agreed.\r
+\r
+> Maybe count can be done by doing two passes? \r
+\r
+What do you mean by pass?\r
+\r
+> If it is difficult it might be sufficient to just document that sort\r
+> has no effect.\r
+\r
+I'd do it this way :)\r
+\r
+Thanks,\r
+-Michal\r