From: David Edmondson <dme@dme.org>
To: notmuch@notmuchmail.org
Subject: [PATCH v2 1/2] emacs: Always insert crypto buttons.
Date: Sun, 3 Apr 2016 16:38:22 +0100 [thread overview]
Message-ID: <1459697903-32673-2-git-send-email-dme@dme.org> (raw)
In-Reply-To: <1459697903-32673-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 | 34 +++++++++++-----------------------
1 file changed, 11 insertions(+), 23 deletions(-)
diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 7c34449..fcb539a 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -642,15 +642,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)
(when 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 the signature status, tell the user how
- ;; they can get it.
- (when button
- (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)))
@@ -666,20 +661,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)
(when button
(button-put button 'face 'notmuch-crypto-part-header))
- ;; Add encryption status button if encryption status is specified.
- (if (plist-member part :encstatus)
- (let ((encstatus (car (plist-get part :encstatus))))
- (notmuch-crypto-insert-encstatus-button encstatus)
- ;; Add signature status button if signature status is
- ;; 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 the encryption status, tell the user how
- ;; they can get it.
- (when button
- (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
next prev parent reply other threads:[~2016-04-03 15:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-03 15:38 [PATCH v2 0/2] Always insert crypto buttons David Edmondson
2016-04-03 15:38 ` David Edmondson [this message]
2016-04-09 19:41 ` [PATCH v2 1/2] emacs: " David Bremner
2016-04-03 15:38 ` [PATCH v2 2/2] Test: Fix tests David Edmondson
2016-04-10 23:53 ` David Bremner
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=1459697903-32673-2-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).