]> git.cworth.org Git - notmuch/commitdiff
emacs: Drop content-free "Unknown signature status" button
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 22 Apr 2019 17:18:14 +0000 (13:18 -0400)
committerDavid Bremner <david@tethera.net>
Sat, 25 May 2019 16:02:02 +0000 (13:02 -0300)
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'

emacs/notmuch-crypto.el
test/emacs-show.expected-output/notmuch-show-decrypted-message
test/emacs-show.expected-output/notmuch-show-decrypted-message-no-crypto
test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
test/emacs-show.expected-output/notmuch-show-undecryptable-message

index 353f721e2593c2fb977612a088d1378534e7ee21..4216f58327a9fb0bef08670fa88f0b6e4723874a 100644 (file)
@@ -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))
 
index 08a9e4f64cff15a56add149830f968dc151c14de..c4ec4b3236bab8767248d8f80d0cce50ad42d9a9 100644 (file)
@@ -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.
index e302e4525d778a93f2ada68a72f8e9ba1ba6274d..49d8533775284dadf4922d1f9e24d820e1350578 100644 (file)
@@ -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 ]
index ce2892a05f3af32c8f01486c889918c5a17cbc7d..3282c7b148d90a8f3d712a6aefb2d4628cd8c0e4 100644 (file)
@@ -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.
 
index 530ff2860889b89f6becee7b70b86df6f9ec0bf8..95c1646bc0a550d4cf1340b53efcd10559929e26 100644 (file)
@@ -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 ]