[PATCH v1 2/3] emacs: Always insert crypto buttons.
authorDavid Edmondson <dme@dme.org>
Tue, 9 Feb 2016 12:23:50 +0000 (12:23 +0000)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:02 +0000 (16:21 -0700)
8f/722fea43f62453a775e6fb751d3889b8ec01db [new file with mode: 0644]

diff --git a/8f/722fea43f62453a775e6fb751d3889b8ec01db b/8f/722fea43f62453a775e6fb751d3889b8ec01db
new file mode 100644 (file)
index 0000000..49993e1
--- /dev/null
@@ -0,0 +1,136 @@
+Return-Path: <dme@dme.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 257FD6DE02CE\r
+ for <notmuch@notmuchmail.org>; Tue,  9 Feb 2016 04:24:00 -0800 (PST)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.045\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.045 tagged_above=-999 required=5 tests=[AWL=0.022,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_NEUTRAL=0.652,\r
+ UNPARSEABLE_RELAY=0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id TDLzUiLMy7oG for <notmuch@notmuchmail.org>;\r
+ Tue,  9 Feb 2016 04:23:58 -0800 (PST)\r
+Received: from mail-wm0-f68.google.com (mail-wm0-f68.google.com\r
+ [74.125.82.68]) by arlo.cworth.org (Postfix) with ESMTPS id 7CCA66DE103A for\r
+ <notmuch@notmuchmail.org>; Tue,  9 Feb 2016 04:23:57 -0800 (PST)\r
+Received: by mail-wm0-f68.google.com with SMTP id g62so3112152wme.2\r
+ for <notmuch@notmuchmail.org>; Tue, 09 Feb 2016 04:23:57 -0800 (PST)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=dme-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:subject:date:message-id:in-reply-to:references;\r
+ bh=FpkU1cEESHbESLW0neDnT8mDZOooZG+SpHGxi4qXqWM=;\r
+ b=uroYL4e4q+uQUKkgpnqRVbQR/j1y3CfzWGJSy5iJx3KvDo/SRkxL3Y+Z6a6JcXHzI/\r
+ kcADodQ/kuIKevqCcuioC2p9i4Gnk1VIrXthEeknlTox3HvDXkG5Y5TywuRNqPykTVX5\r
+ WCEqPxA6z8+Y3kFDgMoxskmKHArvGuOYnGMoNFVXrW9SFKRFW83D9+NMuNdYJmlIQUIt\r
+ Ikms5+KZ6eskCk+upPcDL0+BTHBdexaYklcykKckph74nVqYOF9ZefRBT4znAh6G8dmc\r
+ JHZb5AlT1847aZSIlZAyKXQgDfvIoSLoU5agl/pVtoMNuU68D0q9L2HQ88naI9FITwMt\r
+ kXqQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to\r
+ :references;\r
+ bh=FpkU1cEESHbESLW0neDnT8mDZOooZG+SpHGxi4qXqWM=;\r
+ b=ESwbWKmmL0eTEZUmE6UoDtzhdNN9H+MW8pNJkXqnza67hnsLHMxrfoSifREO0UuaTd\r
+ HBzpF9TzG7E6VnX7hHw66FtmRkQYt3ElNvQgBZuZ0+JGI17Id6tKc1tZ3tWekm0Re4I0\r
+ lMh1vZQdbxChnaOADkNpVO9/ELzMMHhZd4bO/Qs+amGpomqf6gcqRpJGC6eRdFmoCr9R\r
+ 4DkrP9o+ZcwLxuQijxtblJy/a+FRAdnrURsaP6vfgcjKoHMwKasVLaQfmh7EFOjER8eJ\r
+ luYg+jainEHpHd9Xa3hu5oealAYsqEx87zx5ZKFi81EOH2q/I/2nsCbU9AIM8VlnbZVY\r
+ WBgA==\r
+X-Gm-Message-State:\r
+ AG10YORUTVgOWt3vOa5jud6k8CCqDGR6vPWQzU2EwfWR6sr6FUmlOfmpRvBJueGU8FqD1g==\r
+X-Received: by 10.28.175.193 with SMTP id y184mr4918689wme.62.1455020636174;\r
+ Tue, 09 Feb 2016 04:23:56 -0800 (PST)\r
+Received: from disaster-area.hh.sledj.net\r
+ ([2a01:348:1a2:1:ea39:35ff:fe2c:a227])\r
+ by smtp.gmail.com with ESMTPSA id l7sm34513729wjx.14.2016.02.09.04.23.54\r
+ for <notmuch@notmuchmail.org>\r
+ (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 09 Feb 2016 04:23:54 -0800 (PST)\r
+Received: from localhost (disaster-area.hh.sledj.net [local])\r
+ by disaster-area.hh.sledj.net (OpenSMTPD) with ESMTPA id c510b3a9\r
+ for <notmuch@notmuchmail.org>; Tue, 9 Feb 2016 12:23:51 +0000 (UTC)\r
+From: David Edmondson <dme@dme.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH v1 2/3] emacs: Always insert crypto buttons.\r
+Date: Tue,  9 Feb 2016 12:23:50 +0000\r
+Message-Id: <1455020631-15646-3-git-send-email-dme@dme.org>\r
+X-Mailer: git-send-email 2.1.4\r
+In-Reply-To: <1455020631-15646-1-git-send-email-dme@dme.org>\r
+References: <1455020631-15646-1-git-send-email-dme@dme.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 09 Feb 2016 12:24:00 -0000\r
+\r
+When no decryption or signature examination is\r
+happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons\r
+that indicate this, rather than remaining silent.\r
+---\r
+ emacs/notmuch-show.el | 29 +++++++++++------------------\r
+ 1 file changed, 11 insertions(+), 18 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el\r
+index 3345878..4bc5811 100644\r
+--- a/emacs/notmuch-show.el\r
++++ b/emacs/notmuch-show.el\r
+@@ -646,13 +646,10 @@ will return nil if the CID is unknown or cannot be retrieved."\r
\r
+ (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)\r
+   (button-put button 'face 'notmuch-crypto-part-header)\r
+-  ;; add signature status button if sigstatus provided\r
+-  (if (plist-member part :sigstatus)\r
+-      (let* ((from (notmuch-show-get-header :From msg))\r
+-           (sigstatus (car (plist-get part :sigstatus))))\r
+-      (notmuch-crypto-insert-sigstatus-button sigstatus from))\r
+-    ;; if we're not adding sigstatus, tell the user how they can get it\r
+-    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))\r
++\r
++  ;; Insert a button detailing the signature status.\r
++  (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))\r
++                                        (notmuch-show-get-header :From msg))\r
\r
+   (let ((inner-parts (plist-get part :content))\r
+       (start (point)))\r
+@@ -667,17 +664,13 @@ will return nil if the CID is unknown or cannot be retrieved."\r
\r
+ (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)\r
+   (button-put button 'face 'notmuch-crypto-part-header)\r
+-  ;; add encryption status button if encstatus specified\r
+-  (if (plist-member part :encstatus)\r
+-      (let ((encstatus (car (plist-get part :encstatus))))\r
+-      (notmuch-crypto-insert-encstatus-button encstatus)\r
+-      ;; add signature status button if sigstatus specified\r
+-      (if (plist-member part :sigstatus)\r
+-          (let* ((from (notmuch-show-get-header :From msg))\r
+-                 (sigstatus (car (plist-get part :sigstatus))))\r
+-            (notmuch-crypto-insert-sigstatus-button sigstatus from))))\r
+-    ;; if we're not adding encstatus, tell the user how they can get it\r
+-    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))\r
++\r
++  ;; Insert a button detailing the encryption status.\r
++  (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))\r
++\r
++  ;; Insert a button detailing the signature status.\r
++  (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))\r
++                                        (notmuch-show-get-header :From msg))\r
\r
+   (let ((inner-parts (plist-get part :content))\r
+       (start (point)))\r
+-- \r
+2.1.4\r
+\r