unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v1 2/3] emacs: Always insert crypto buttons.
Date: Tue,  9 Feb 2016 12:23:50 +0000	[thread overview]
Message-ID: <1455020631-15646-3-git-send-email-dme@dme.org> (raw)
In-Reply-To: <1455020631-15646-1-git-send-email-dme@dme.org>

When no decryption or signature examination is
happening (i.e. `notmuch-crypto-process-mime' is `nil') insert buttons
that indicate this, rather than remaining silent.
---
 emacs/notmuch-show.el | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 3345878..4bc5811 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -646,13 +646,10 @@ will return nil if the CID is unknown or cannot be retrieved."
 
 (defun notmuch-show-insert-part-multipart/signed (msg part content-type nth depth button)
   (button-put button 'face 'notmuch-crypto-part-header)
-  ;; add signature status button if sigstatus provided
-  (if (plist-member part :sigstatus)
-      (let* ((from (notmuch-show-get-header :From msg))
-	     (sigstatus (car (plist-get part :sigstatus))))
-	(notmuch-crypto-insert-sigstatus-button sigstatus from))
-    ;; if we're not adding sigstatus, tell the user how they can get it
-    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))
+
+  ;; Insert a button detailing the signature status.
+  (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
+					  (notmuch-show-get-header :From msg))
 
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
@@ -667,17 +664,13 @@ will return nil if the CID is unknown or cannot be retrieved."
 
 (defun notmuch-show-insert-part-multipart/encrypted (msg part content-type nth depth button)
   (button-put button 'face 'notmuch-crypto-part-header)
-  ;; add encryption status button if encstatus specified
-  (if (plist-member part :encstatus)
-      (let ((encstatus (car (plist-get part :encstatus))))
-	(notmuch-crypto-insert-encstatus-button encstatus)
-	;; add signature status button if sigstatus specified
-	(if (plist-member part :sigstatus)
-	    (let* ((from (notmuch-show-get-header :From msg))
-		   (sigstatus (car (plist-get part :sigstatus))))
-	      (notmuch-crypto-insert-sigstatus-button sigstatus from))))
-    ;; if we're not adding encstatus, tell the user how they can get it
-    (button-put button 'help-echo "Set notmuch-crypto-process-mime to process cryptographic MIME parts."))
+
+  ;; Insert a button detailing the encryption status.
+  (notmuch-crypto-insert-encstatus-button (car (plist-get part :encstatus)))
+
+  ;; Insert a button detailing the signature status.
+  (notmuch-crypto-insert-sigstatus-button (car (plist-get part :sigstatus))
+					  (notmuch-show-get-header :From msg))
 
   (let ((inner-parts (plist-get part :content))
 	(start (point)))
-- 
2.1.4

  parent reply	other threads:[~2016-02-09 12:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-09 12:23 [PATCH v1 0/3] Always insert crypto buttons David Edmondson
2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
2016-03-24 11:01   ` David Bremner
2016-02-09 12:23 ` David Edmondson [this message]
2016-03-24 11:00   ` [PATCH v1 2/3] emacs: Always insert crypto buttons David Bremner
2016-04-03 15:40     ` David Edmondson
2016-02-09 12:23 ` [PATCH v1 3/3] Test: Fix tests David Edmondson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1455020631-15646-3-git-send-email-dme@dme.org \
    --to=dme@dme.org \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).