notmuch.git  about / heads / tags
Unnamed repository; edit this file 'description' to name the repository.
   commit 7d3aacbf1440512b58f4394875d60938caef2409 (patch)
   parent 12de0166 Improve handling of message/rfc822 parts by adding a new header_message_part function to the formating structure.
     tree 61c597ac444abe8125b3344af6977922b623904b
   author Jameson Graef Rollins <jrollins@finestructure.net>  2011-06-05 17:29:29 -0700
committer David Bremner <bremner@debian.org>                  2011-09-05 22:58:52 -0300

emacs: Improve support for message/rfc822 parts.

The insert-part-message/rfc822 function is overhauled to properly
processes the new formatting of message/rfc822 parts.  The json output
for message parts now includes "headers" and "body" fields, which are
now parsed and output appropriately.
---
 emacs/notmuch-show.el | 21 +++++++++++++--------
 1 file changed, 13 insertions(+), 8 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index f96743b0..90f9af7f 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -508,21 +508,26 @@ current buffer, if possible."
   t)
 
 (defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)
-  (let* ((message-part (plist-get part :content))
-	 (inner-parts (plist-get message-part :content)))
-    (notmuch-show-insert-part-header nth declared-type content-type nil)
+  (notmuch-show-insert-part-header nth declared-type content-type nil)
+  (let* ((message (car (plist-get part :content)))
+	 (headers (plist-get message :headers))
+	 (body (car (plist-get message :body)))
+	 (start (point)))
+
     ;; Override `notmuch-message-headers' to force `From' to be
     ;; displayed.
     (let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
-      (notmuch-show-insert-headers (plist-get part :headers)))
+      (notmuch-show-insert-headers (plist-get message :headers)))
+
     ;; Blank line after headers to be compatible with the normal
     ;; message display.
     (insert "\n")
 
-    ;; Show all of the parts.
-    (mapc (lambda (inner-part)
-	    (notmuch-show-insert-bodypart msg inner-part depth))
-	  inner-parts))
+    ;; Show the body
+    (notmuch-show-insert-bodypart msg body depth)
+
+    (when notmuch-show-indent-multipart
+      (indent-rigidly start (point) 1)))
   t)
 
 (defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)


glossary
--------
Commit objects reference one tree, and zero or more parents.

Single parent commits can typically generate a patch in
unified diff format via `git format-patch'.

Multiple parents means the commit is a merge.

Root commits have no ancestor.  Note that it is
possible to have multiple root commits when merging independent histories.

Every commit references one top-level tree object.

git clone https://yhetil.org/notmuch.git