From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
To: Notmuch Mail <notmuch@notmuchmail.org>
Subject: [PATCH 3/3] emacs: Drop content-free "Unknown signature status" button
Date: Mon, 22 Apr 2019 13:18:14 -0400 [thread overview]
Message-ID: <20190422171814.16480-3-dkg@fifthhorseman.net> (raw)
In-Reply-To: <20190422171814.16480-1-dkg@fifthhorseman.net>
When we have not been able to evaluate the signature status of a given
MIME part, showing a content-free (and interaction-free) "[ Unknown
signature status ]" button doesn't really help the user at all, and
takes up valuable screen real-estate.
A visual reminder that a given message is *not* signed isn't helpful
unless it is always present, in which case we'd want to see "[ Unknown
signature status ]" buttons on all messages, even ones that don't have
a signing structure, but i don't think we want that.
---
emacs/notmuch-crypto.el | 27 ++++++++++---------
.../notmuch-show-decrypted-message | 1 -
.../notmuch-show-decrypted-message-no-crypto | 1 -
...notmuch-show-process-crypto-mime-parts-off | 1 -
.../notmuch-show-undecryptable-message | 1 -
5 files changed, 15 insertions(+), 16 deletions(-)
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 353f721e..68171153 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -93,6 +93,7 @@ mode."
(defun notmuch-crypto-insert-sigstatus-button (sigstatus from)
(let* ((status (plist-get sigstatus :status))
(help-msg nil)
+ (show-button t)
(label "Signature not processed")
(face 'notmuch-crypto-signature-unknown)
(button-action (lambda (button) (message (button-get button 'help-echo)))))
@@ -118,19 +119,21 @@ mode."
(let ((keyid (concat "0x" (plist-get sigstatus :keyid))))
(setq label (concat "Bad signature (claimed key ID " keyid ")"))
(setq face 'notmuch-crypto-signature-bad)))
+ (status
+ (setq label (concat "Unknown signature status: " status)))
(t
- (setq label (concat "Unknown signature status"
- (if status (concat ": " status))))))
- (insert-button
- (concat "[ " label " ]")
- :type 'notmuch-crypto-status-button-type
- 'help-echo help-msg
- 'face face
- 'mouse-face face
- 'action button-action
- :notmuch-sigstatus sigstatus
- :notmuch-from from)
- (insert "\n")))
+ (setq show-button nil)))
+ (when show-button
+ (insert-button
+ (concat "[ " label " ]")
+ :type 'notmuch-crypto-status-button-type
+ 'help-echo help-msg
+ 'face face
+ 'mouse-face face
+ 'action button-action
+ :notmuch-sigstatus sigstatus
+ :notmuch-from from)
+ (insert "\n"))))
(declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
diff --git a/test/emacs-show.expected-output/notmuch-show-decrypted-message b/test/emacs-show.expected-output/notmuch-show-decrypted-message
index 08a9e4f6..c4ec4b32 100644
--- a/test/emacs-show.expected-output/notmuch-show-decrypted-message
+++ b/test/emacs-show.expected-output/notmuch-show-decrypted-message
@@ -5,7 +5,6 @@ Date: Sat, 01 Jan 2000 12:00:00 +0000
[ multipart/encrypted ]
[ Decryption successful ]
-[ Unknown signature status ]
[ application/pgp-encrypted ]
[ text/plain ]
The password is "abcd1234!", please do not tell anyone.
diff --git a/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto b/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto
index e302e452..49d85337 100644
--- a/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto
+++ b/test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto
@@ -5,6 +5,5 @@ Date: Sat, 01 Jan 2000 12:00:00 +0000
[ multipart/encrypted ]
[ Unknown encryption status ]
-[ Unknown signature status ]
[ application/pgp-encrypted ]
[ application/octet-stream ]
diff --git a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
index ce2892a0..3282c7b1 100644
--- a/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
+++ b/test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
@@ -9,7 +9,6 @@ Subject: [notmuch] Working with Maildir storage?
[ multipart/mixed ]
[ multipart/signed ]
- [ Unknown signature status ]
[ text/plain ]
> See the patch just posted here.
diff --git a/test/emacs-show.expected-output/notmuch-show-undecryptable-message b/test/emacs-show.expected-output/notmuch-show-undecryptable-message
index 530ff286..95c1646b 100644
--- a/test/emacs-show.expected-output/notmuch-show-undecryptable-message
+++ b/test/emacs-show.expected-output/notmuch-show-undecryptable-message
@@ -5,6 +5,5 @@ Date: Thu, 22 Dec 2016 08:34:56 -0400
[ multipart/encrypted ]
[ Decryption error ]
-[ Unknown signature status ]
[ application/pgp-encrypted ]
[ application/octet-stream ]
--
2.20.1
next prev parent reply other threads:[~2019-04-22 17:18 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-22 17:18 [PATCH 1/3] emacs: test notmuch-show during message decryption Daniel Kahn Gillmor
2019-04-22 17:18 ` [PATCH 2/3] test: show what emacs sees of an encrypted message when crypto is disabled Daniel Kahn Gillmor
2019-05-10 15:33 ` David Bremner
2019-04-22 17:18 ` Daniel Kahn Gillmor [this message]
2019-04-22 17:26 ` [PATCH 3/3] emacs: Drop content-free "Unknown signature status" button Daniel Kahn Gillmor
2019-04-23 16:18 ` Daniel Kahn Gillmor
2019-05-20 3:16 ` Daniel Kahn Gillmor
2019-05-24 1:13 ` David Bremner
2019-05-24 19:21 ` Daniel Kahn Gillmor
2019-05-25 1:38 ` David Bremner
2019-05-25 14:23 ` Daniel Kahn Gillmor
2019-05-25 16:40 ` David Bremner
2019-04-22 21:07 ` [PATCH v2 1/3] emacs: test notmuch-show during message decryption Daniel Kahn Gillmor
2019-05-03 17:59 ` David Bremner
2019-05-06 16:23 ` Daniel Kahn Gillmor
2019-05-06 17:43 ` [PATCH v3 " Daniel Kahn Gillmor
2019-05-10 10:17 ` 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=20190422171814.16480-3-dkg@fifthhorseman.net \
--to=dkg@fifthhorseman.net \
--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).