]> git.cworth.org Git - notmuch/commitdiff
emacs: add duplicate support to notmuch-show-view-raw-message
authorDavid Bremner <david@tethera.net>
Thu, 4 Aug 2022 11:48:08 +0000 (08:48 -0300)
committerDavid Bremner <david@tethera.net>
Sun, 7 Aug 2022 10:05:49 +0000 (07:05 -0300)
This fixes one of the bugs reported by Gregor in [1]

[1]: id:87edxw8jp4.fsf@no.workgroup

emacs/notmuch-show.el
test/T450-emacs-show.sh

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)
index 83e902f1d8a626c88b391aab9070f2088dce3f93..c4202e0a3dcde3abdbe139316000de291bcf5ff9 100755 (executable)
@@ -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)