]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: reply: remove wrong sig/enc status buttons
authorMark Walters <markwalters1009@gmail.com>
Tue, 13 Sep 2016 01:45:58 +0000 (22:45 -0300)
committerDavid Bremner <david@tethera.net>
Sun, 18 Sep 2016 13:57:27 +0000 (10:57 -0300)
This stops the (usually incorrect) sigstatus and encstatus buttons
appearing when replying in emacs, and updates the test suite to match.

Overriding the status button functions is a little unusual but much
less intrusive than passing an argument all the way down the call
chain. It also makes it clear exactly what it does.

We also hide the application/pgp-encrypted part as it can only contain
"Version: 1". We do this in notmuch show, which means it also happens
when replying.

emacs/notmuch-mua.el
emacs/notmuch-show.el
test/T310-emacs.sh
test/T350-crypto.sh

index fadf20fec7a7d6312ec8ad86d744b8743e9a129d..55bc267205756392fdbd6f243a420e0762b6c0a5 100644 (file)
@@ -253,8 +253,11 @@ mutiple parts get a header."
                       (notmuch-show-insert-header-p-function notmuch-mua-reply-insert-header-p-function)
                       ;; Don't indent multipart sub-parts.
                       (notmuch-show-indent-multipart nil))
-                   (notmuch-show-insert-body original (plist-get original :body) 0)
-                   (buffer-substring-no-properties (point-min) (point-max)))))
+                   ;; We don't want sigstatus buttons (an information leak and usually wrong anyway).
+                   (letf (((symbol-function 'notmuch-crypto-insert-sigstatus-button) #'ignore)
+                          ((symbol-function 'notmuch-crypto-insert-encstatus-button) #'ignore))
+                         (notmuch-show-insert-body original (plist-get original :body) 0)
+                         (buffer-substring-no-properties (point-min) (point-max))))))
 
        (set-mark (point))
        (goto-char start)
index 5a585f38652791752a221c50a6fc3859e145069e..641398dc838ab10b4e17dbb4767a78b3ab0be667 100644 (file)
@@ -682,6 +682,9 @@ will return nil if the CID is unknown or cannot be retrieved."
       (indent-rigidly start (point) 1)))
   t)
 
+(defun notmuch-show-insert-part-application/pgp-encrypted (msg part content-type nth depth button)
+  t)
+
 (defun notmuch-show-insert-part-multipart/* (msg part content-type nth depth button)
   (let ((inner-parts (plist-get part :content))
        (start (point)))
index 202fc3bfcfc34abda008e95b96228d7cbc3156f6..21675b687f1bc20d8b086f35c00a289fb16d4349 100755 (executable)
@@ -384,8 +384,6 @@ References: <20091118002059.067214ed@hikari>
 --text follows this line--
 Adrian Perez de Castro <aperez@igalia.com> writes:
 
-> [ Unknown signature status ]
->
 > Hello to all,
 >
 > I have just heard about Not Much today in some random Linux-related news
index 8e29897977e3e5b2952a2429ea5c8fb2fddf8ba4..df2dc7439c1586d2b13a0a558f99f9b89f37c89f 100755 (executable)
@@ -317,7 +317,6 @@ test_expect_equal \
     "$expected"
 
 test_begin_subtest "Reply within emacs to an encrypted message"
-test_subtest_known_broken
 test_emacs "(let ((message-hidden-headers '())
       (notmuch-crypto-process-mime 't))
   (notmuch-show \"subject:test.encrypted.message.002\")