From 476ec883ac3270151cd73769c641cad52582818c Mon Sep 17 00:00:00 2001 From: Dave Barker Date: Sun, 16 Oct 2016 22:12:14 +0200 Subject: [PATCH] Update my-notmuch-show-view-as-patch example --- emacstips.mdwn | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/emacstips.mdwn b/emacstips.mdwn index 04c8521..2ba9e92 100644 --- a/emacstips.mdwn +++ b/emacstips.mdwn @@ -700,16 +700,18 @@ refine, next hunk etc all work. "View the the current message as a patch." (interactive) (let* ((id (notmuch-show-get-message-id)) + (msg (notmuch-show-get-message-properties)) + (part (notmuch-show-get-part-properties)) (subject (concat "Subject: " (notmuch-show-get-subject) "\n")) (diff-default-read-only t) (buf (get-buffer-create (concat "*notmuch-patch-" id "*"))) (map (make-sparse-keymap))) - (define-key map "q" 'notmuch-kill-this-buffer) + (define-key map "q" 'notmuch-bury-or-kill-this-buffer) (switch-to-buffer buf) (let ((inhibit-read-only t)) (erase-buffer) (insert subject) - (insert (notmuch-get-bodypart-internal id 1 nil))) + (insert (notmuch-get-bodypart-text msg part nil))) (set-buffer-modified-p nil) (diff-mode) (lexical-let ((new-ro-bind (cons 'buffer-read-only map))) -- 2.43.0