From: Austin Clements Date: Tue, 27 Aug 2013 13:47:24 +0000 (+2000) Subject: Re: Feature proposal: OUTPUT_AUTHOR format X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=052ca138b3ffada010cd0f4a95ed596d1221810d;p=notmuch-archives.git Re: Feature proposal: OUTPUT_AUTHOR format --- diff --git a/22/380886848b7a3564f8ca7c59947aa4644f8631 b/22/380886848b7a3564f8ca7c59947aa4644f8631 new file mode 100644 index 000000000..84f4b114a --- /dev/null +++ b/22/380886848b7a3564f8ca7c59947aa4644f8631 @@ -0,0 +1,127 @@ +Return-Path: +X-Original-To: notmuch@notmuchmail.org +Delivered-To: notmuch@notmuchmail.org +Received: from localhost (localhost [127.0.0.1]) + by olra.theworths.org (Postfix) with ESMTP id 22840431FD4 + for ; Tue, 27 Aug 2013 06:47:41 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled +Received: from olra.theworths.org ([127.0.0.1]) + by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) + with ESMTP id kK4f8Ex+uy2o for ; + Tue, 27 Aug 2013 06:47:33 -0700 (PDT) +Received: from dmz-mailsec-scanner-2.mit.edu (dmz-mailsec-scanner-2.mit.edu + [18.9.25.13]) + by olra.theworths.org (Postfix) with ESMTP id 976F1431FAF + for ; Tue, 27 Aug 2013 06:47:33 -0700 (PDT) +X-AuditID: 1209190d-b7f078e000000937-c1-521cadf4664f +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-2.mit.edu (Symantec Messaging Gateway) with SMTP + id EF.8A.02359.4FDAC125; Tue, 27 Aug 2013 09:47:32 -0400 (EDT) +Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id r7RDlUK5023029; + Tue, 27 Aug 2013 09:47:31 -0400 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.8/8.12.4) with ESMTP id r7RDlRgE007416 + (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NOT); + Tue, 27 Aug 2013 09:47:29 -0400 +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.80) + (envelope-from ) + id 1VEJcE-0005UV-55; Tue, 27 Aug 2013 09:47:26 -0400 +Date: Tue, 27 Aug 2013 09:47:24 -0400 +From: Austin Clements +To: Johannes Kulick +Subject: Re: Feature proposal: OUTPUT_AUTHOR format +Message-ID: <20130827134723.GQ13257@mit.edu> +References: <20130825101308.27461.57489@quirm.robotics.tu-berlin.de> + <20130826222226.1093.84929@quirm.robotics.tu-berlin.de> + <87li3o9dwr.fsf@zancas.localnet> + <20130827115004.11629.64740@quirm.robotics.tu-berlin.de> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20130827115004.11629.64740@quirm.robotics.tu-berlin.de> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpmleLIzCtJLcpLzFFi42IRYrdT0f2yVibI4P8vAYuj37czWVy/OZPZ + gcljydfDjB7PVt1iDmCK4rJJSc3JLEst0rdL4Mpo3XaBveAub0XT8/nsDYzfuLoYOTgkBEwk + /v6K6WLkBDLFJC7cW8/WxcjFISSwj1Hi1Ou/jBDORkaJo//fQWVOM0lse3OSGcJZwihxaf0y + VpB+FgFViTVNPSwgNpuAhsS2/csZQVaICGhLnPruDRJmFpCW+Pa7mQnEFhYwltj9byEziM0r + oCNx9NItqAV3GCX+L1nCBpEQlDg58wkLRLOWxI1/L5lAZoIMWv6PAyTMKeAq0Tz9CdhMUQEV + iSknt7FNYBSahaR7FpLuWQjdCxiZVzHKpuRW6eYmZuYUpybrFicn5uWlFuka6eVmluilppRu + YgSFNack7w7GdweVDjEKcDAq8fA+aJEOEmJNLCuuzD3EKMnBpCTKm7NGJkiILyk/pTIjsTgj + vqg0J7X4EKMEB7OSCO/uFUA53pTEyqrUonyYlDQHi5I479OnZwOFBNITS1KzU1MLUotgsjIc + HEoSvOtBhgoWpaanVqRl5pQgpJk4OEGG8wAN/wxSw1tckJhbnJkOkT/FqCglznsCJCEAksgo + zYPrhaWdV4ziQK8I8zIAk5AQDzBlwXW/AhrMBDR42nywwSWJCCmpBsakfwb2k+qTKj2KXi8T + nra645nF87LLc16l8E7n4b3+efXVX3NXtvDv+dOr9/FEgqpwW2avEIvka/8TgXdzNkswfone + dsRyr6mk2ofwnGOWwtEKPyZt/b0hdMat6jcSC5Y31Ekmv3aWnf5ylnGFpH+Ota/eftfjnZvy + njNINdUa3HRWWMN7IkSJpTgj0VCLuag4EQCZMBztFgMAAA== +Cc: notmuch@notmuchmail.org +X-BeenThere: notmuch@notmuchmail.org +X-Mailman-Version: 2.1.13 +Precedence: list +List-Id: "Use and development of the notmuch mail system." + +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +X-List-Received-Date: Tue, 27 Aug 2013 13:47:41 -0000 + +Quoth Johannes Kulick on Aug 27 at 1:50 pm: +> Hi David, +> +> Quoting David Bremner (2013-08-27 02:27:00) +> > I'm not sure I understand your goal completely here, but the obvious +> > thing UI wise would be +> > +> > notmuch search --output=authors --format=(json|text|sexp) $search_terms +> > +> > Perhaps you're already aware of this, but alot doesn't use the CLI, so +> > that wouldn't be directly helpful to having a new view in alot. +> +> Do you mean, that this output=authors option is already available? Then I'm not +> aware. If it is not available it's exactly what I meant. So it would look + +No, --output=authors isn't currently available. + +> something like: +> +> $ notmuch search --output=authors from:Johannes +> Johannes Kulick (1234 msgs) +> Johannes Doe (123 msgs) +> Johannes Mueller (12 msgs) +> ... +> +> I'd sketch the way to implement it like this: +> +> - add notmuch_authors_t and notmuch_author_t structs +> - add a notmuch_database_get_all_authors (notmuch_database_t *db) +> - add the functions around that to actually get an option for the ui +> - add bindings for the other languages + +What's the advantage to adding this to the library? Why not just +notmuch_query_search_messages, iterate over the messages and use +notmuch_message_get_header(msg, "from") to accumulate the author +information, and then output that? Unless I'm overlooking something +(which is possible), there are no algorithmic advantages to doing this +in the library. + +As David pointed out, for alot you could do this right away, since it +uses the library directly. For notmuch-emacs you would have to extend +the CLI along the lines you're imagining. + +> (- implement the view in the clients) +> +> Cheers, +> Johannes +>