[PATCH] emacs: process crypto for reply only when specified

Jameson Graef Rollins jrollins at finestructure.net
Sun Apr 6 23:40:14 PDT 2014


This is a tweak to patch "emacs: sign/encrypt replies to
signed/encrypted messages" to only add mml crypto flags for replys
when crypto processing has been activated.

---

Thanks to mjw1009 for implementation suggestions.

Jani, you might consider squashing this with your original for a v2.
Pushing them separately seems fine to me as well.

jamie.

---
 emacs/notmuch-mua.el | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el
index 9fb84b5..bf6253f 100644
--- a/emacs/notmuch-mua.el
+++ b/emacs/notmuch-mua.el
@@ -160,9 +160,10 @@ list."
 
 (defun notmuch-mua-reply (query-string &optional sender reply-all)
   (let ((args '("reply" "--format=sexp" "--format-version=1"))
+	(process-crypto notmuch-show-process-crypto)
 	reply
 	original)
-    (when notmuch-show-process-crypto
+    (when process-crypto
       (setq args (append args '("--decrypt"))))
 
     (if reply-all
@@ -236,7 +237,8 @@ list."
 	(message-cite-original)))
 
     ;; Sign and/or encrypt replies to signed and/or encrypted messages.
-    (notmuch-mua-reply-crypto (plist-get original :body)))
+    (when process-crypto
+      (notmuch-mua-reply-crypto (plist-get original :body))))
 
   ;; Push mark right before signature, if any.
   (message-goto-signature)
-- 
1.9.1



More information about the notmuch mailing list