unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH v1 0/3] Always insert crypto buttons.
@ 2016-02-09 12:23 David Edmondson
  2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: David Edmondson @ 2016-02-09 12:23 UTC (permalink / raw)
  To: notmuch


Always insert crypto buttons.

This set of patches is in response to the discussion started in
id:87silucnfx.fsf@maritornes.cs.unb.ca and specifically the comments
from dkg in id:53CDEAE8.3000607@fifthhorseman.net.


David Edmondson (3):
  emacs: Improve crypto button labels.
  emacs: Always insert crypto buttons.
  Test: Fix tests.

 emacs/notmuch-crypto.el                            |  7 +++---
 emacs/notmuch-show.el                              | 29 ++++++++--------------
 .../notmuch-show-elide-non-matching-messages-off   |  3 +++
 .../notmuch-show-elide-non-matching-messages-on    |  3 +++
 .../notmuch-show-indent-thread-content-off         |  3 +++
 .../notmuch-show-process-crypto-mime-parts-off     |  1 +
 .../notmuch-show-thread-maildir-storage            |  4 +++
 ...hread-maildir-storage-with-fourfold-indentation |  4 +++
 ...show-thread-maildir-storage-without-indentation |  4 +++
 test/tree.expected-output/notmuch-tree-show-window |  1 +
 10 files changed, 38 insertions(+), 21 deletions(-)

-- 
2.1.4

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v1 1/3] emacs: Improve crypto button labels.
  2016-02-09 12:23 [PATCH v1 0/3] Always insert crypto buttons David Edmondson
@ 2016-02-09 12:23 ` David Edmondson
  2016-03-24 11:01   ` David Bremner
  2016-02-09 12:23 ` [PATCH v1 2/3] emacs: Always insert crypto buttons David Edmondson
  2016-02-09 12:23 ` [PATCH v1 3/3] Test: Fix tests David Edmondson
  2 siblings, 1 reply; 7+ messages in thread
From: David Edmondson @ 2016-02-09 12:23 UTC (permalink / raw)
  To: notmuch

Make the labels for both encryption and signature buttons share a common
format, in which both report the status if it is not one of those known.
---
 emacs/notmuch-crypto.el | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 5233824..73ebf51 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -110,8 +110,8 @@ mode."
 	(setq label (concat "Bad signature (claimed key ID " keyid ")"))
 	(setq face 'notmuch-crypto-signature-bad)))
      (t
-      (setq label "Unknown signature status")
-      (if status (setq label (concat label " \"" status "\"")))))
+      (setq label (concat "Unknown signature status"
+			  (if status (concat ": " status))))))
     (insert-button
      (concat "[ " label " ]")
      :type 'notmuch-crypto-status-button-type
@@ -161,7 +161,8 @@ mode."
      ((string= status "bad")
       (setq label "Decryption error"))
      (t
-      (setq label (concat "Unknown encstatus \"" status "\""))))
+      (setq label (concat "Unknown encryption status"
+			  (if status (concat ": " status))))))
     (insert-button
      (concat "[ " label " ]")
      :type 'notmuch-crypto-status-button-type
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 2/3] emacs: Always insert crypto buttons.
  2016-02-09 12:23 [PATCH v1 0/3] Always insert crypto buttons David Edmondson
  2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
@ 2016-02-09 12:23 ` David Edmondson
  2016-03-24 11:00   ` David Bremner
  2016-02-09 12:23 ` [PATCH v1 3/3] Test: Fix tests David Edmondson
  2 siblings, 1 reply; 7+ messages in thread
From: David Edmondson @ 2016-02-09 12:23 UTC (permalink / raw)
  To: notmuch

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 | 29 +++++++++++------------------
 1 file changed, 11 insertions(+), 18 deletions(-)

diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el
index 3345878..4bc5811 100644
--- a/emacs/notmuch-show.el
+++ b/emacs/notmuch-show.el
@@ -646,13 +646,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)
   (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 sigstatus, tell the user how they can get it
-    (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)))
@@ -667,17 +664,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)
   (button-put button 'face 'notmuch-crypto-part-header)
-  ;; add encryption status button if encstatus specified
-  (if (plist-member part :encstatus)
-      (let ((encstatus (car (plist-get part :encstatus))))
-	(notmuch-crypto-insert-encstatus-button encstatus)
-	;; add signature status button if sigstatus 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 encstatus, tell the user how they can get it
-    (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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH v1 3/3] Test: Fix tests.
  2016-02-09 12:23 [PATCH v1 0/3] Always insert crypto buttons David Edmondson
  2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
  2016-02-09 12:23 ` [PATCH v1 2/3] emacs: Always insert crypto buttons David Edmondson
@ 2016-02-09 12:23 ` David Edmondson
  2 siblings, 0 replies; 7+ messages in thread
From: David Edmondson @ 2016-02-09 12:23 UTC (permalink / raw)
  To: notmuch

---
 .../notmuch-show-elide-non-matching-messages-off                      | 3 +++
 .../notmuch-show-elide-non-matching-messages-on                       | 3 +++
 .../emacs-show.expected-output/notmuch-show-indent-thread-content-off | 3 +++
 .../notmuch-show-process-crypto-mime-parts-off                        | 1 +
 test/emacs.expected-output/notmuch-show-thread-maildir-storage        | 4 ++++
 .../notmuch-show-thread-maildir-storage-with-fourfold-indentation     | 4 ++++
 .../notmuch-show-thread-maildir-storage-without-indentation           | 4 ++++
 test/tree.expected-output/notmuch-tree-show-window                    | 1 +
 8 files changed, 23 insertions(+)

diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
index b31fe62..9f1e91f 100644
--- a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
+++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-off
@@ -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
diff --git a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
index bafb479..118053b 100644
--- a/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
+++ b/test/emacs-show.expected-output/notmuch-show-elide-non-matching-messages-on
@@ -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
diff --git a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
index 37b4f7d..2cb1211 100644
--- a/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
+++ b/test/emacs-show.expected-output/notmuch-show-indent-thread-content-off
@@ -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
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 3282c7b..ce2892a 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,6 +9,7 @@ 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.expected-output/notmuch-show-thread-maildir-storage b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
index cdbfa1d..3599892 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage
@@ -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
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
index b0bf93e..4721b8b 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-with-fourfold-indentation
@@ -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
diff --git a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
index 08de8b5..62a4635 100644
--- a/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
+++ b/test/emacs.expected-output/notmuch-show-thread-maildir-storage-without-indentation
@@ -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
diff --git a/test/tree.expected-output/notmuch-tree-show-window b/test/tree.expected-output/notmuch-tree-show-window
index e16792b..ab7205b 100644
--- a/test/tree.expected-output/notmuch-tree-show-window
+++ b/test/tree.expected-output/notmuch-tree-show-window
@@ -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
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/3] emacs: Always insert crypto buttons.
  2016-02-09 12:23 ` [PATCH v1 2/3] emacs: Always insert crypto buttons David Edmondson
@ 2016-03-24 11:00   ` David Bremner
  2016-04-03 15:40     ` David Edmondson
  0 siblings, 1 reply; 7+ messages in thread
From: David Bremner @ 2016-03-24 11:00 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> 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.

I'm afraid starting at patch 2 this series needs rebasing against
master.

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 1/3] emacs: Improve crypto button labels.
  2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
@ 2016-03-24 11:01   ` David Bremner
  0 siblings, 0 replies; 7+ messages in thread
From: David Bremner @ 2016-03-24 11:01 UTC (permalink / raw)
  To: David Edmondson, notmuch

David Edmondson <dme@dme.org> writes:

> Make the labels for both encryption and signature buttons share a common
> format, in which both report the status if it is not one of those known.
> ---

Pushed this one patch, since surprisingly it doesn't break the test
suite.

d

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v1 2/3] emacs: Always insert crypto buttons.
  2016-03-24 11:00   ` David Bremner
@ 2016-04-03 15:40     ` David Edmondson
  0 siblings, 0 replies; 7+ messages in thread
From: David Edmondson @ 2016-04-03 15:40 UTC (permalink / raw)
  To: David Bremner, notmuch

On Thu, Mar 24 2016, David Bremner <david@tethera.net> wrote:
> David Edmondson <dme@dme.org> writes:
>
>> 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.
>
> I'm afraid starting at patch 2 this series needs rebasing against
> master.

An updated patch set is sent trailing along behind
id:1459697903-32673-1-git-send-email-dme@dme.org.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2016-04-03 15:40 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-09 12:23 [PATCH v1 0/3] Always insert crypto buttons David Edmondson
2016-02-09 12:23 ` [PATCH v1 1/3] emacs: Improve crypto button labels David Edmondson
2016-03-24 11:01   ` David Bremner
2016-02-09 12:23 ` [PATCH v1 2/3] emacs: Always insert crypto buttons David Edmondson
2016-03-24 11:00   ` David Bremner
2016-04-03 15:40     ` David Edmondson
2016-02-09 12:23 ` [PATCH v1 3/3] Test: Fix tests David Edmondson

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).