--- /dev/null
+Return-Path: <tomi.ollila@iki.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 165AB429E26\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Nov 2014 01:44:54 -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 8qVqfRLDh-dj for <notmuch@notmuchmail.org>;\r
+ Mon, 3 Nov 2014 01:44:46 -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 CBB50431FAE\r
+ for <notmuch@notmuchmail.org>; Mon, 3 Nov 2014 01:44:45 -0800 (PST)\r
+Received: from guru.guru-group.fi (localhost [IPv6:::1])\r
+ by guru.guru-group.fi (Postfix) with ESMTP id A0250100033;\r
+ Mon, 3 Nov 2014 11:44:17 +0200 (EET)\r
+From: Tomi Ollila <tomi.ollila@iki.fi>\r
+To: Michal Sojka <sojkam1@fel.cvut.cz>,\r
+ Mark Walters <markwalters1009@gmail.com>, notmuch@notmuchmail.org\r
+Subject: Re: [PATCH v6 6/7] cli: search: Add --output=count\r
+In-Reply-To: <b1fb8387-6ae4-4f9c-aee6-f4758f010751@email.android.com>\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
+ <87d2963q87.fsf@qmul.ac.uk>\r
+ <b1fb8387-6ae4-4f9c-aee6-f4758f010751@email.android.com>\r
+User-Agent: Notmuch/0.18.2+169~g5bcdd1c (http://notmuchmail.org) Emacs/24.3.1\r
+ (x86_64-unknown-linux-gnu)\r
+X-Face: HhBM'cA~<r"^Xv\KRN0P{vn'Y"Kd;zg_y3S[4)KSN~s?O\"QPoL\r
+ $[Xv_BD:i/F$WiEWax}R(MPS`^UaptOGD`*/=@\1lKoVa9tnrg0TW?"r7aRtgk[F\r
+ !)g;OY^,BjTbr)Np:%c_o'jj,Z\r
+Date: Mon, 03 Nov 2014 11:44:16 +0200\r
+Message-ID: <m2d2947h5b.fsf@guru.guru-group.fi>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=utf-8\r
+Content-Transfer-Encoding: quoted-printable\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: Mon, 03 Nov 2014 09:44:54 -0000\r
+\r
+On Sun, Nov 02 2014, Michal Sojka <sojkam1@fel.cvut.cz> wrote:\r
+\r
+> On 2. listopadu 2014 10:29:28 CET, Mark Walters <markwalters1009@gmail.co=\r
+m> wrote:\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=3Drecipients or --output=3Dsend=\r
+er\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
+>>++++++++++++++++++++++++++++++++------\r
+>>>>> 4 files changed, 52 insertions(+), 12 deletions(-)\r
+>>>>>\r
+>>>>> diff --git a/completion/notmuch-completion.bash\r
+>>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=3D( $( compgen -W "summary threads messages files\r
+>>tags sender recipients" -- "${cur}" ) )\r
+>>>>> + COMPREPLY=3D( $( compgen -W "summary threads messages files\r
+>>tags sender recipients count" -- "${cur}" ) )\r
+>>>>> return\r
+>>>>> ;;\r
+>>>>> --sort)\r
+>>>>> diff --git a/completion/notmuch-completion.zsh\r
+>>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=3D[display only the first x threads from the\r
+>>search results]:number of threads to show: ' \\r
+>>>>> '--first=3D[omit the first x threads from the search\r
+>>results]:number of threads to omit: ' \\r
+>>>>> '--sort=3D[sort results]:sorting:((newest-first\:"reverse\r
+>>chronological order" oldest-first\:"chronological order"))' \\r
+>>>>> - '--output=3D[select what to output]:output:((summary threads\r
+>>messages files tags sender recipients))'\r
+>>>>> + '--output=3D[select what to output]:output:((summary threads\r
+>>messages files tags sender recipients count))'\r
+>>>>> }\r
+>>>>>=20=20\r
+>>>>> _notmuch()\r
+>>>>> diff --git a/doc/man1/notmuch-search.rst\r
+>>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
+>>>>>=20=20\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=3D``\ (**newest-first**\ \|\ **oldest-first**)\r
+>>>>\r
+>>>> I think sort works as expected if count is not specified, but does\r
+>>not\r
+>>>> with count.=20\r
+>>>\r
+>>> Agreed.\r
+>>>\r
+>>>> Maybe count can be done by doing two passes?=20\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
+> That's what the patch does. Only the second time it iterates the hash.\r
+\r
+Sorry=20\r
+\r
+And we loose the order ? (or not ?) do we have "orderedhash" there...\r
+I'd like to save the order (but that is not so important) -- but\r
+more importantly, are tests robusts --- ah there is sort -n in the test...\r
+\r
+>\r
+> Michal\r
+\r
+Tomi\r
+\r
+>\r
+> --=20\r
+> Odesl=C3=A1no z m=C3=A9ho telefonu pomoc=C3=AD Kaiten Mail. Omluvte pros=\r
+=C3=ADm mou stru=C4=8Dnost.\r
+> _______________________________________________\r
+> notmuch mailing list\r
+> notmuch@notmuchmail.org\r
+> http://notmuchmail.org/mailman/listinfo/notmuch\r