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 A0CEF6DE01F7 for ; Mon, 12 Sep 2016 15:12:26 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.362 X-Spam-Level: X-Spam-Status: No, score=-0.362 tagged_above=-999 required=5 tests=[AWL=0.208, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] 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 jtYOJY2uC3Ro for ; Mon, 12 Sep 2016 15:12:25 -0700 (PDT) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by arlo.cworth.org (Postfix) with ESMTPS id 6A1A56DE00BD for ; Mon, 12 Sep 2016 15:12:25 -0700 (PDT) Received: by mail-wm0-f66.google.com with SMTP id b187so15566161wme.0 for ; Mon, 12 Sep 2016 15:12:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=gvdt5pZWB8nn29B0ilbu43fkPJpuS96mxSEBGtQ/7Jk=; b=tEEFMD5Q9l7P94gchoQ8yOq4XAMKcWU7mA1+Dvb259o7YE5sFajU/DpccPLyAeVWj8 Fl7sGJ4tjV0VVpkVKfsVPCwSri2Vk0pyZo9O6yNXjEiYz4bGAVN3T3QK7qe/4vCHZy4Z UzDe8gIBxsANivEbF5hVIZ/314RoSwaAP0GA+b2jD+ys10KTdCcZU7vO0HfqGctRxuf+ LCjNOpWFSCj+fdoSvkUOUnfUQKCnnaw4F2E7qrNLI2e1zk9rTVvFOZL74K/2EEBVZhzx 6aQhyPRAmO4gMbsHkhbf8J/1nAmU6r+G0jHmirufD1S+T/Fz4tcOP/bR8TUctFnCMsXc 5Ovw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gvdt5pZWB8nn29B0ilbu43fkPJpuS96mxSEBGtQ/7Jk=; b=Ytf+9LUz9zmVYNiXRUGCew5D4HHG11ck0cQkGKv8Jxjr9NzEsH35DGQwYFzyxuQkG+ YDjOAitAY/3F4EZ9rz+A7v4n9URGuV+evbf65u01OcBc8LdDvgxgrbA8Zoh8EkdqhyIf xzUXexd69QfbJV2do1ehUwjyWJzSgBsNL1Zw3RXedCRJtfWKeeHLGxnvGcNU5SIskJEz bbp4sPnTFp56gIH3xszfw/t4lpRkECFDlwbfbuj7rwHlKxnpj7UD1gfm/QQtFPDL0ncY j0GjOx6VjbkwK3oWvjgq/pIzKxlBK4K1Xfm+7EbS/Cbh7blVvN6Oj478pO1kCPu+8Y4K 7Rug== X-Gm-Message-State: AE9vXwNJtqalxhtcToLy8HiVmoueiwRxfInlphh0gd9l2n3pI3XRyoABBkKTJemgdU5Czw== X-Received: by 10.28.146.211 with SMTP id u202mr12215586wmd.54.1473718342325; Mon, 12 Sep 2016 15:12:22 -0700 (PDT) Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162]) by smtp.gmail.com with ESMTPSA id hy3sm19790357wjb.8.2016.09.12.15.12.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Sep 2016 15:12:21 -0700 (PDT) From: Mark Walters To: notmuch@notmuchmail.org Subject: [PATCH v2] emacs: reply: remove wrong sig/enc status buttons Date: Mon, 12 Sep 2016 23:12:19 +0100 Message-Id: <1473718339-19946-1-git-send-email-markwalters1009@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <877fahq5v3.fsf@zancas.localnet> References: <877fahq5v3.fsf@zancas.localnet> 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: Mon, 12 Sep 2016 22:12:26 -0000 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. 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. --- This fixes the bug David mentioned of Version: 1 appearing in the reply. We actually fix it by making notmuch-show.el not display this either. The patch is as before but with the addition of the 3 lines for notmuch-show. Best wishes Mark emacs/notmuch-mua.el | 7 +++++-- emacs/notmuch-show.el | 3 +++ test/T310-emacs.sh | 2 -- 3 files changed, 8 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/emacs/notmuch-show.el b/emacs/notmuch-show.el index eb6877e..0c7d8a1 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 -- 2.1.4