From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id CFF616DE02AF for ; Mon, 12 Sep 2016 18:46:24 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.007 X-Spam-Level: X-Spam-Status: No, score=-0.007 tagged_above=-999 required=5 tests=[AWL=0.004, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xY02Hn_vCxBk for ; Mon, 12 Sep 2016 18:46:24 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id EFB516DE02D9 for ; Mon, 12 Sep 2016 18:46:23 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.84_2) (envelope-from ) id 1bjcnf-00058h-Tn; Mon, 12 Sep 2016 21:46:15 -0400 Received: (nullmailer pid 24514 invoked by uid 1000); Tue, 13 Sep 2016 01:46:22 -0000 From: David Bremner To: Mark Walters , notmuch@notmuchmail.org Subject: [PATCH 2/2] emacs: reply: remove wrong sig/enc status buttons Date: Mon, 12 Sep 2016 22:45:58 -0300 Message-Id: <20160913014558.24392-3-david@tethera.net> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20160913014558.24392-1-david@tethera.net> References: <1473718339-19946-1-git-send-email-markwalters1009@gmail.com> <20160913014558.24392-1-david@tethera.net> X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Sep 2016 01:46:24 -0000 From: Mark Walters 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 | 7 +++++-- emacs/notmuch-show.el | 3 +++ test/T310-emacs.sh | 2 -- test/T350-crypto.sh | 3 --- 4 files changed, 8 insertions(+), 7 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/emacs/notmuch-show.el b/emacs/notmuch-show.el index 5a585f3..641398d 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -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))) 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 writes: -> [ Unknown signature status ] -> > Hello to all, > > I have just heard about Not Much today in some random Linux-related news diff --git a/test/T350-crypto.sh b/test/T350-crypto.sh index 28ea9ad..df2dc74 100755 --- a/test/T350-crypto.sh +++ b/test/T350-crypto.sh @@ -331,9 +331,6 @@ Subject: Re: test encrypted message 002 <#secure method=pgpmime mode=signencrypt> Notmuch Test Suite writes: -> [ Decryption successful ] -> [ Good signature by: Notmuch Test Suite (INSECURE!) ] -> Version: 1 > This is another test encrypted message. EOF test_expect_equal_file EXPECTED OUTPUT.clean -- 2.9.3