]> git.notmuchmail.org Git - notmuch/commitdiff
emacs: Always insert crypto buttons.
authorDavid Edmondson <dme@dme.org>
Sun, 3 Apr 2016 15:38:22 +0000 (16:38 +0100)
committerDavid Bremner <david@tethera.net>
Sun, 10 Apr 2016 23:46:58 +0000 (20:46 -0300)
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
test/T310-emacs.sh
test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
test/emacs-show.expected-output/notmuch-show-process-crypto-mime-parts-off
test/emacs.expected-output/notmuch-show-thread-maildir-storage
test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
test/tree.expected-output/notmuch-tree-show-window

index f6a21e4702b04bbb33456bab7946212f16da597e..46e3869de86e6186ab823cfd8472fb2f468335b7 100644 (file)
@@ -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)))
index 43b9973667f8e8a7037350ee064d059cfa8cd8d7..daa02568f5f988f6638753fd20887b4b66a9e8ba 100755 (executable)
@@ -394,6 +394,8 @@ User-Agent: Notmuch/XXX Emacs/XXX
 --text follows this line--
 Adrian Perez de Castro <aperez@igalia.com> writes:
 
+> [ Unknown signature status ]
+>
 > Hello to all,
 >
 > I have just heard about Not Much today in some random Linux-related news
index b31fe622c9b541305aaea24a4134fd532c26592c..9f1e91f0373c093f95cff3403203db3721487d25 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -39,6 +40,7 @@ Cheers,
 
   [ multipart/mixed ]
   [ multipart/signed ]
+  [ Unknown signature status ]
   [ text/plain ]
   > See the patch just posted here.
 
@@ -65,6 +67,7 @@ Cheers,
 
     [ multipart/mixed ]
     [ multipart/signed ]
+    [ Unknown signature status ]
     [ text/plain ]
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
index bafb479ece3640f55745a5b4bae926a236c10223..118053ba1b496b2710a2e440c3542629e06d0657 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -38,6 +39,7 @@ Cheers,
 
   [ multipart/mixed ]
   [ multipart/signed ]
+  [ Unknown signature status ]
   [ text/plain ]
   > See the patch just posted here.
 
@@ -62,6 +64,7 @@ Cheers,
 
     [ multipart/mixed ]
     [ multipart/signed ]
+    [ Unknown signature status ]
     [ text/plain ]
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
index 37b4f7de1d4646634cde6007c45f1326dfd89468..2cb1211800362c241c3c9421972c1c4c5cd3b051 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -39,6 +40,7 @@ Date: Tue, 17 Nov 2009 15:33:01 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 > See the patch just posted here.
 
@@ -65,6 +67,7 @@ Date: Tue, 17 Nov 2009 19:50:40 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 > I've also pushed a slightly more complicated (and complete) fix to my
 > private notmuch repository
index 3282c7b148d90a8f3d712a6aefb2d4628cd8c0e4..ce2892a05f3af32c8f01486c889918c5a17cbc7d 100644 (file)
@@ -9,6 +9,7 @@ Subject: [notmuch] Working with Maildir storage?
 
   [ multipart/mixed ]
   [ multipart/signed ]
+  [ Unknown signature status ]
   [ text/plain ]
   > See the patch just posted here.
 
index cdbfa1d7e18476c32ca8483936b061bacf09d674..359989228b5a7a768e15ad15420c3e232ada583f 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -45,6 +46,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
  [ multipart/mixed ]
  [ multipart/signed ]
+ [ Unknown signature status ]
  [ text/plain ]
 
  Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did
@@ -77,6 +79,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
   [ multipart/mixed ]
   [ multipart/signed ]
+  [ Unknown signature status ]
   [ text/plain ]
   > See the patch just posted here.
 
@@ -159,6 +162,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
     [ multipart/mixed ]
     [ multipart/signed ]
+    [ Unknown signature status ]
     [ text/plain ]
     > I've also pushed a slightly more complicated (and complete) fix to my
     > private notmuch repository
index b0bf93edc99146050a21e6b1e8ab3bc354b4ff15..4721b8b0875d5267d7907d73f80f8165dc538fb6 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -45,6 +46,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
     [ multipart/mixed ]
     [ multipart/signed ]
+    [ Unknown signature status ]
     [ text/plain ]
 
     Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did
@@ -77,6 +79,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
        [ multipart/mixed ]
        [ multipart/signed ]
+       [ Unknown signature status ]
        [ text/plain ]
        > See the patch just posted here.
 
@@ -159,6 +162,7 @@ http://notmuchmail.org/mailman/listinfo/notmuch
 
                [ multipart/mixed ]
                [ multipart/signed ]
+               [ Unknown signature status ]
                [ text/plain ]
                > I've also pushed a slightly more complicated (and complete) fix to my
                > private notmuch repository
index 08de8b5da86a9fd9cb2b873e02b59744018f70f6..62a463535e5bbe3231994959c8913be7731f668f 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of
@@ -45,6 +46,7 @@ Date: Wed, 18 Nov 2009 01:02:38 +0600
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 
 Twas brillig at 14:00:54 17.11.2009 UTC-05 when lars@seas.harvard.edu did
@@ -77,6 +79,7 @@ Date: Tue, 17 Nov 2009 15:33:01 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 > See the patch just posted here.
 
@@ -159,6 +162,7 @@ Date: Tue, 17 Nov 2009 19:50:40 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 > I've also pushed a slightly more complicated (and complete) fix to my
 > private notmuch repository
index e16792b886c9cef47a2938324a991f73d29d736e..ab7205b7b8dd7d1d861ec044806882ac5ab58115 100644 (file)
@@ -5,6 +5,7 @@ Date: Tue, 17 Nov 2009 14:00:54 -0500
 
 [ multipart/mixed ]
 [ multipart/signed ]
+[ Unknown signature status ]
 [ text/plain ]
 I saw the LWN article and decided to take a look at notmuch.  I'm
 currently using mutt and mairix to index and read a collection of