diff options
| author | Daniel Kahn Gillmor <dkg@fifthhorseman.net> | 2019-04-22 13:18:14 -0400 |
|---|---|---|
| committer | David Bremner <david@tethera.net> | 2019-05-25 13:02:02 -0300 |
| commit | 9300defd64acf68b8e6fa6fbd89b8050168bb63d (patch) | |
| tree | 9bce075e3085cab432b54018950c675d2733e95d /emacs | |
| parent | fa9d8b702666adc5fe5759c352a9e8467c436804 (diff) | |
emacs: Drop content-free "Unknown signature status" button
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.
Amended by db to drop the unused initialization of 'label'
Diffstat (limited to 'emacs')
| -rw-r--r-- | emacs/notmuch-crypto.el | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el index 353f721e..4216f583 100644 --- a/emacs/notmuch-crypto.el +++ b/emacs/notmuch-crypto.el @@ -93,7 +93,8 @@ mode." (defun notmuch-crypto-insert-sigstatus-button (sigstatus from) (let* ((status (plist-get sigstatus :status)) (help-msg nil) - (label "Signature not processed") + (show-button t) + (label nil) (face 'notmuch-crypto-signature-unknown) (button-action (lambda (button) (message (button-get button 'help-echo))))) (cond @@ -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)) |
