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