diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index e9a9ac2c..a6650678 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -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) diff --git a/test/T450-emacs-show.sh b/test/T450-emacs-show.sh index 83e902f1..c4202e0a 100755 --- a/test/T450-emacs-show.sh +++ b/test/T450-emacs-show.sh @@ -383,7 +383,6 @@ test_expect_equal_file_nonempty $EXPECTED/notmuch-show-duplicate-4 OUTPUT FILE4=$(notmuch search --output=files --duplicate=4 "id:${ID3}") test_begin_subtest "duplicate=4, raw" -test_subtest_known_broken test_emacs "(notmuch-show \"id:${ID3}\") (notmuch-show-choose-duplicate 4) (notmuch-show-view-raw-message)