--- /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 0D57D431FD7\r
+ for <notmuch@notmuchmail.org>; Sun, 2 Nov 2014 01:29:47 -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 SyS4H+buG9+z for <notmuch@notmuchmail.org>;\r
+ Sun, 2 Nov 2014 01:29:39 -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 778FA431FAF\r
+ for <notmuch@notmuchmail.org>; Sun, 2 Nov 2014 01:29:39 -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 1XkrTX-0004SS-E6; Sun, 02 Nov 2014 09:29:37 +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 1XkrTW-0006nm-RN; Sun, 02 Nov 2014 09:29:31 +0000\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v6 6/7] cli: search: Add --output=count\r
+In-Reply-To: <87bnoqbexm.fsf@steelpick.2x.cz>\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> <87bnoqbexm.fsf@steelpick.2x.cz>\r
+User-Agent: Notmuch/0.18.1+86~gef5e66a (http://notmuchmail.org) Emacs/23.4.1\r
+ (x86_64-pc-linux-gnu)\r
+Date: Sun, 02 Nov 2014 09:29:28 +0000\r
+Message-ID: <87d2963q87.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: fff3332d8322b566dca8b716cdc10c85 (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
+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 09:29:47 -0000\r
+\r
+\r
+Hi\r
+\r
+On Sun, 02 Nov 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\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
+I mean iterating through the messages twice: so the first time would\r
+fill in the count in the hash map, and the second iteration would print\r
+the addresses.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\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