mirror of
https://git.notmuchmail.org/git/notmuch
synced 2024-11-22 10:58:10 +01:00
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.
This commit is contained in:
parent
12de016686
commit
7d3aacbf14
1 changed files with 13 additions and 8 deletions
|
@ -508,21 +508,26 @@ current buffer, if possible."
|
||||||
t)
|
t)
|
||||||
|
|
||||||
(defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)
|
(defun notmuch-show-insert-part-message/rfc822 (msg part content-type nth depth declared-type)
|
||||||
(let* ((message-part (plist-get part :content))
|
(notmuch-show-insert-part-header nth declared-type content-type nil)
|
||||||
(inner-parts (plist-get message-part :content)))
|
(let* ((message (car (plist-get part :content)))
|
||||||
(notmuch-show-insert-part-header nth declared-type content-type nil)
|
(headers (plist-get message :headers))
|
||||||
|
(body (car (plist-get message :body)))
|
||||||
|
(start (point)))
|
||||||
|
|
||||||
;; Override `notmuch-message-headers' to force `From' to be
|
;; Override `notmuch-message-headers' to force `From' to be
|
||||||
;; displayed.
|
;; displayed.
|
||||||
(let ((notmuch-message-headers '("From" "Subject" "To" "Cc" "Date")))
|
(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
|
;; Blank line after headers to be compatible with the normal
|
||||||
;; message display.
|
;; message display.
|
||||||
(insert "\n")
|
(insert "\n")
|
||||||
|
|
||||||
;; Show all of the parts.
|
;; Show the body
|
||||||
(mapc (lambda (inner-part)
|
(notmuch-show-insert-bodypart msg body depth)
|
||||||
(notmuch-show-insert-bodypart msg inner-part depth))
|
|
||||||
inner-parts))
|
(when notmuch-show-indent-multipart
|
||||||
|
(indent-rigidly start (point) 1)))
|
||||||
t)
|
t)
|
||||||
|
|
||||||
(defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)
|
(defun notmuch-show-insert-part-text/plain (msg part content-type nth depth declared-type)
|
||||||
|
|
Loading…
Reference in a new issue