]> git.cworth.org Git - notmuch-wiki/commitdiff
Update my-notmuch-show-view-as-patch example
authorDave Barker <kzar@kzar.co.uk>
Sun, 16 Oct 2016 20:12:14 +0000 (22:12 +0200)
committerDave Barker <kzar@kzar.co.uk>
Sun, 16 Oct 2016 20:12:14 +0000 (22:12 +0200)
emacstips.mdwn

index 04c85219c6d80a95922bc0571984b2d662b3d555..2ba9e9208071b45a03d160c03fb332fc50d57c69 100644 (file)
@@ -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)))