unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH] emacs: reply: remove wrong sig/enc status buttons
@ 2016-09-11 16:08 Mark Walters
  2016-09-12  1:11 ` David Bremner
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Walters @ 2016-09-11 16:08 UTC (permalink / raw)
  To: notmuch

This stopps 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.
---

I dont't have any encrypted messages for testing but it seems to work
on signed messages (but even that is very lightly tested). 

Best wishes

Mark



emacs/notmuch-mua.el | 7 +++++--
 test/T310-emacs.sh   | 2 --
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index fadf20f..55bc267 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -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)
diff --git a/test/T310-emacs.sh b/test/T310-emacs.sh
index 202fc3b..21675b6 100755
--- a/test/T310-emacs.sh
+++ b/test/T310-emacs.sh
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2016-09-18 14:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-11 16:08 [PATCH] emacs: reply: remove wrong sig/enc status buttons Mark Walters
2016-09-12  1:11 ` David Bremner
2016-09-12 16:57   ` Daniel Kahn Gillmor
2016-09-12 22:12   ` [PATCH v2] " Mark Walters
2016-09-12 23:30     ` Daniel Kahn Gillmor
2016-09-13  7:35       ` Mark Walters
2016-09-13 10:41       ` David Bremner
2016-09-13  1:45     ` David Bremner
2016-09-13  1:45       ` [PATCH 1/2] test/crypto: test reply to encrypted message in emacs David Bremner
2016-09-18 14:08         ` David Bremner
2016-09-13  1:45       ` [PATCH 2/2] emacs: reply: remove wrong sig/enc status buttons David Bremner

Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).