[PATCH 5/5] emacs: Improve support for message/rfc822 parts.
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 6 Jun 2011 00:29:29 +0000 (17:29 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:38:33 +0000 (09:38 -0800)
01/88500ddd013fff1e93de9a3c8fc078c5ae72ea [new file with mode: 0644]

diff --git a/01/88500ddd013fff1e93de9a3c8fc078c5ae72ea b/01/88500ddd013fff1e93de9a3c8fc078c5ae72ea
new file mode 100644 (file)
index 0000000..dd16667
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <jrollins@servo.finestructure.net>\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 B1D14429E2D\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:39 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -1.921\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5\r
+       tests=[NO_DNS_FOR_FROM=0.379, RCVD_IN_DNSWL_MED=-2.3]\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 FnWd37KUdLrQ for <notmuch@notmuchmail.org>;\r
+       Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id A450F431FB6\r
+       for <notmuch@notmuchmail.org>; Sun,  5 Jun 2011 17:29:37 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id B394E66E02A6;\r
+       Sun,  5 Jun 2011 17:29:35 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from servo.finestructure.net (cpe-98-149-172-122.socal.res.rr.com\r
+       [98.149.172.122]) (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id 73D3166E02D4;\r
+       Sun,  5 Jun 2011 17:29:32 -0700 (PDT)\r
+Received: by servo.finestructure.net (Postfix, from userid 1000)\r
+       id 2592BB52; Sun,  5 Jun 2011 17:29:31 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH 5/5] emacs: Improve support for message/rfc822 parts.\r
+Date: Sun,  5 Jun 2011 17:29:29 -0700\r
+Message-Id: <1307320169-29905-6-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.7.4.4\r
+In-Reply-To: <1307320169-29905-5-git-send-email-jrollins@finestructure.net>\r
+References: <87sjrsi2b4.fsf@servo.factory.finestructure.net>\r
+       <1307320169-29905-1-git-send-email-jrollins@finestructure.net>\r
+       <1307320169-29905-2-git-send-email-jrollins@finestructure.net>\r
+       <1307320169-29905-3-git-send-email-jrollins@finestructure.net>\r
+       <1307320169-29905-4-git-send-email-jrollins@finestructure.net>\r
+       <1307320169-29905-5-git-send-email-jrollins@finestructure.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, 06 Jun 2011 00:29:39 -0000\r
+\r
+The insert-part-message/rfc822 function is overhauled to properly\r
+processes the new formatting of message/rfc822 parts.  The json output\r
+for message parts now includes "headers" and "body" fields, which are\r
+now parsed and output appropriately.\r
+---\r
+ emacs/notmuch-show.el |   21 +++++++++++++--------\r
+ 1 files changed, 13 insertions(+), 8 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 7d848e3..0f1fe69 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -519,21 +519,26 @@ current buffer, if possible."\r
+   t)\r
\r
+ (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)\r
+-  (let* ((message-part (plist-get part :content))\r
+-       (inner-parts (plist-get message-part :content)))\r
+-    (notmuch-show-insert-part-header nth declared-type content-type nil)\r
++  (notmuch-show-insert-part-header nth declared-type content-type nil)\r
++  (let* ((message (car (plist-get part :content)))\r
++       (headers (plist-get message :headers))\r
++       (body (car (plist-get message :body)))\r
++       (start (point)))\r
++\r
+     ;; Override `notmuch-message-headers' to force `From' to be\r
+     ;; displayed.\r
+     (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))\r
+-      (notmuch-show-insert-headers (plist-get part :headers)))\r
++      (notmuch-show-insert-headers (plist-get message :headers)))\r
++\r
+     ;; Blank line after headers to be compatible with the normal\r
+     ;; message display.\r
+     (insert "\n")\r
\r
+-    ;; Show all of the parts.\r
+-    (mapc (lambda (inner-part)\r
+-          (notmuch-show-insert-bodypart msg inner-part depth))\r
+-        inner-parts))\r
++    ;; Show the body\r
++    (notmuch-show-insert-bodypart msg body depth)\r
++\r
++    (when notmuch-show-indent-multipart\r
++      (indent-rigidly start (point) 1)))\r
+   t)\r
\r
+ (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)\r
+-- \r
+1.7.4.4\r
+\r