Re: Feature proposal: OUTPUT_AUTHOR format
authorAustin Clements <amdragon@MIT.EDU>
Tue, 27 Aug 2013 13:47:24 +0000 (09:47 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:56:42 +0000 (09:56 -0800)
22/380886848b7a3564f8ca7c59947aa4644f8631 [new file with mode: 0644]

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