]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: add inline patch fake parts through a special handler
authorJani Nikula <jani@nikula.org>
Tue, 27 Dec 2011 16:04:38 +0000 (18:04 +0200)
committerDavid Bremner <bremner@debian.org>
Wed, 28 Dec 2011 12:18:13 +0000 (08:18 -0400)
Add wash generated inline patch fake parts through a special
"inline-patch-fake-part" handler to distinguish them from real MIME
parts. The fake parts are described as "inline patch (as text/x-diff)".

Signed-off-by: Jani Nikula <jani@nikula.org>
emacs/notmuch-show.el
emacs/notmuch-wash.el

index eee4da9896434c327e545d904a058f4a0e2687d8..6ef3f90f1f39892aa305bb246f95de6deb540f2e 100644 (file)
@@ -585,6 +585,10 @@ current buffer, if possible."
                nil))
          nil))))
 
                nil))
          nil))))
 
+;; Handler for wash generated inline patch fake parts.
+(defun notmuch-show-insert-part-inline-patch-fake-part (msg part content-type nth depth declared-type)
+  (notmuch-show-insert-part-*/* msg part "text/x-diff" nth depth "inline patch"))
+
 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)
   ;; This handler _must_ succeed - it is the handler of last resort.
   (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))
 (defun notmuch-show-insert-part-*/* (msg part content-type nth depth declared-type)
   ;; This handler _must_ succeed - it is the handler of last resort.
   (notmuch-show-insert-part-header nth content-type declared-type (plist-get part :filename))
index 1f420b25a05d770556cd19e4e737f522b7e18098..e9f2dbad577963dcc7976544f8a26df8b1e8fc9f 100644 (file)
@@ -313,7 +313,7 @@ for error."
              (setq patch-end (match-beginning 0)))
          (save-restriction
            (narrow-to-region patch-start patch-end)
              (setq patch-end (match-beginning 0)))
          (save-restriction
            (narrow-to-region patch-start patch-end)
-           (setq part (plist-put part :content-type "text/x-diff"))
+           (setq part (plist-put part :content-type "inline-patch-fake-part"))
            (setq part (plist-put part :content (buffer-string)))
            (setq part (plist-put part :id -1))
            (setq part (plist-put part :filename "inline patch"))
            (setq part (plist-put part :content (buffer-string)))
            (setq part (plist-put part :id -1))
            (setq part (plist-put part :filename "inline patch"))