]> git.cworth.org Git - notmuch/blobdiff - emacs/notmuch-show.el
emacs: add duplicate support to notmuch-show-view-raw-message
[notmuch] / emacs / notmuch-show.el
index e9a9ac2cc08c6e00dd7a0e18fa8a1f61430c071a..a66506780005fb1940dfa6e229b339c0f16b1119 100644 (file)
@@ -2143,12 +2143,16 @@ to show, nil otherwise."
   "View the original source of the current message."
   (interactive)
   (let* ((id (notmuch-show-get-message-id))
-        (buf (get-buffer-create (concat "*notmuch-raw-" id "*")))
+        (duplicate (notmuch-show-get-duplicate))
+        (args (if (> duplicate 1)
+                  (list (format "--duplicate=%d" duplicate) id)
+                (list id)))
+        (buf (get-buffer-create (format "*notmuch-raw-%s-%d*" id duplicate)))
         (inhibit-read-only t))
     (pop-to-buffer-same-window buf)
     (erase-buffer)
     (let ((coding-system-for-read 'no-conversion))
-      (notmuch--call-process notmuch-command nil t nil "show" "--format=raw" id))
+      (apply #'notmuch--call-process notmuch-command nil t nil "show" "--format=raw" args))
     (goto-char (point-min))
     (set-buffer-modified-p nil)
     (setq buffer-read-only t)