From: Dave Barker Date: Sun, 16 Oct 2016 20:12:14 +0000 (+0200) Subject: Update my-notmuch-show-view-as-patch example X-Git-Url: https://git.cworth.org/git?p=notmuch-wiki;a=commitdiff_plain;h=476ec883ac3270151cd73769c641cad52582818c Update my-notmuch-show-view-as-patch example --- 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)))