[PATCH 0/4] First step of 'show' rewrite
authorAustin Clements <amdragon@MIT.EDU>
Mon, 28 Nov 2011 02:21:07 +0000 (21:21 +1900)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:40:26 +0000 (09:40 -0800)
0c/428e930099dda920cb9160e359afda8ab496a6 [new file with mode: 0644]

diff --git a/0c/428e930099dda920cb9160e359afda8ab496a6 b/0c/428e930099dda920cb9160e359afda8ab496a6
new file mode 100644 (file)
index 0000000..66163cc
--- /dev/null
@@ -0,0 +1,94 @@
+Return-Path: <amthrax@drake.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 92609429E25\r
+       for <notmuch@notmuchmail.org>; Sun, 27 Nov 2011 18:21:20 -0800 (PST)\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 ZSMLNvWTrHil for <notmuch@notmuchmail.org>;\r
+       Sun, 27 Nov 2011 18:21:20 -0800 (PST)\r
+Received: from dmz-mailsec-scanner-7.mit.edu (DMZ-MAILSEC-SCANNER-7.MIT.EDU\r
+       [18.7.68.36])\r
+       by olra.theworths.org (Postfix) with ESMTP id 100BF431FB6\r
+       for <notmuch@notmuchmail.org>; Sun, 27 Nov 2011 18:21:20 -0800 (PST)\r
+X-AuditID: 12074424-b7ef76d0000008dc-41-4ed2f01d85be\r
+Received: from mailhub-auth-3.mit.edu ( [18.9.21.43])\r
+       by dmz-mailsec-scanner-7.mit.edu (Symantec Messaging Gateway) with SMTP\r
+       id 8B.F4.02268.D10F2DE4; Sun, 27 Nov 2011 21:21:17 -0500 (EST)\r
+Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
+       by mailhub-auth-3.mit.edu (8.13.8/8.9.2) with ESMTP id pAS2LHWM020199; \r
+       Sun, 27 Nov 2011 21:21:17 -0500\r
+Received: from drake.mit.edu\r
+       (209-6-116-242.c3-0.arl-ubr1.sbo-arl.ma.cable.rcn.com\r
+       [209.6.116.242]) (authenticated bits=0)\r
+       (User authenticated as amdragon@ATHENA.MIT.EDU)\r
+       by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id pAS2LEaw020617\r
+       (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
+       Sun, 27 Nov 2011 21:21:16 -0500 (EST)\r
+Received: from amthrax by drake.mit.edu with local (Exim 4.76)\r
+       (envelope-from <amthrax@drake.mit.edu>)\r
+       id 1RUqqI-0003v6-Kj; Sun, 27 Nov 2011 21:21:14 -0500\r
+From: Austin Clements <amdragon@MIT.EDU>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH 0/4] First step of 'show' rewrite\r
+Date: Sun, 27 Nov 2011 21:21:07 -0500\r
+Message-Id: <1322446871-14986-1-git-send-email-amdragon@mit.edu>\r
+X-Mailer: git-send-email 1.7.5.4\r
+X-Brightmail-Tracker:\r
+ H4sIAAAAAAAAA+NgFtrOIsWRmVeSWpSXmKPExsUixCmqrSv74ZKfwc4H1hat3Z+ZLK5u7We3\r
+       2LPPy+L6zZnMDiweZ7vbWT3unuby2DnrLrvHs1W3mANYorhsUlJzMstSi/TtErgylp5rYSxo\r
+       4aro/6PcwDiXo4uRk0NCwETi65PZLBC2mMSFe+vZuhi5OIQE9jFK3O7rZIJwNjBKLJjzAypz\r
+       n0nizeReKGc+o8TfC7dZQfrZBDQktu1fzghiiwhIS+y8OxssziwQJTHnE0SNsIChxO4fLcwg\r
+       NouAqkTXhU9MIDavgIPE7etzGCHuUJD4dWQV6wRG3gWMDKsYZVNyq3RzEzNzilOTdYuTE/Py\r
+       Uot0zfVyM0v0UlNKNzGCwofdRWUHY/MhpUOMAhyMSjy8Gy5f8hNiTSwrrsw9xCjJwaQkyvvi\r
+       HVCILyk/pTIjsTgjvqg0J7X4EKMEB7OSCG/PUaAcb0piZVVqUT5MSpqDRUmc12ang5+QQHpi\r
+       SWp2ampBahFMVoaDQ0mCN+k9UKNgUWp6akVaZk4JQpqJgxNkOA/Q8AkgNbzFBYm5xZnpEPlT\r
+       jIpS4rw5IAkBkERGaR5cLyy+XzGKA70izBsOUsUDTA1w3a+ABjMBDeaYeQFkcEkiQkqqgdH6\r
+       ykqlTYfY95696Wascn1L3xbxB7fcpjy5bbjXumTl0+f/f36rLozz2Sg6pUWoz29J3uVllbPz\r
+       3gWHOZQeFph72Inz36Wgu7t2PT/KEphoZrDc2S/o8+4IU5n3P65wHZnsePCsr0fbB4F/h1yv\r
+       6a7bkrzTtfiCruUp3TRpC3kr0dXf3Fl096gosRRnJBpqMRcVJwIAXpos3soCAAA=\r
+Cc: dkg@fifthhorseman.net\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, 28 Nov 2011 02:21:20 -0000\r
+\r
+This is the first step in my rewrite of notmuch-show.  Currently, MIME\r
+traversal is controlled by show_message_body, which invokes formatter\r
+callbacks.  As a result, formatters have no control over traversal,\r
+which complicates formatters and makes others (like raw) nigh\r
+impossible to implement correctly.  The callback-driven approach\r
+forces formatters to be written in many small pieces and masks the\r
+true control flow.  It also results in an wide interface with\r
+show_message_body that has been getting wider over time.\r
+\r
+The goal of this rewrite is to reverse this relationship, so that\r
+formatters control MIME traversal.  This lets formatters traverse the\r
+MIME in the most appropriate way, eliminates the callbacks, makes the\r
+control flow through a formatter clear, and dramatically narrows\r
+interfaces.\r
+\r
+This first series doesn't change the way formatters work, but it does\r
+introduce the MIME-traversal API they'll use.  This API consists of a\r
+total of two functions: one to get the root MIME part of a message and\r
+one to get a child of a MIME part.  This allows basic MIME traversal\r
+to be implemented in a simple, two-line for loop.  The series also\r
+updates show_message_body to use this new API, though ultimately\r
+show_message_body will go away entirely.\r
+\r