[PATCH] emacs: process crypto for reply only when specified
authorJameson Graef Rollins <jrollins@finestructure.net>
Mon, 7 Apr 2014 06:40:14 +0000 (23:40 +1700)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 18:01:22 +0000 (10:01 -0800)
b5/81aa6632eec7b8404a095dd5b22ad20fb16918 [new file with mode: 0644]

diff --git a/b5/81aa6632eec7b8404a095dd5b22ad20fb16918 b/b5/81aa6632eec7b8404a095dd5b22ad20fb16918
new file mode 100644 (file)
index 0000000..b6457fe
--- /dev/null
@@ -0,0 +1,98 @@
+Return-Path: <jrollins@finestructure.net>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id 3C6D5431FC0\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Apr 2014 23:40:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -2.3\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5\r
+       tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id Vx6imgSaXmPy for <notmuch@notmuchmail.org>;\r
+       Sun,  6 Apr 2014 23:40:16 -0700 (PDT)\r
+Received: from outgoing-mail.its.caltech.edu (outgoing-mail.its.caltech.edu\r
+       [131.215.239.19])\r
+       by olra.theworths.org (Postfix) with ESMTP id C4BEF431FBF\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Apr 2014 23:40:16 -0700 (PDT)\r
+Received: from earth-doxen.imss.caltech.edu (localhost [127.0.0.1])\r
+       by earth-doxen-postvirus (Postfix) with ESMTP id 8CB8A66E01B8\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Apr 2014 23:40:16 -0700 (PDT)\r
+X-Spam-Scanned: at Caltech-IMSS on earth-doxen by amavisd-new\r
+Received: from finestructure.net (cpe-107-185-189-81.socal.res.rr.com\r
+       [107.185.189.81]) (Authenticated sender: jrollins)\r
+       by earth-doxen-submit (Postfix) with ESMTP id 20FF366E0151\r
+       for <notmuch@notmuchmail.org>; Sun,  6 Apr 2014 23:40:15 -0700 (PDT)\r
+Received: by finestructure.net (Postfix, from userid 1000)\r
+       id CA39F60187; Sun,  6 Apr 2014 23:40:14 -0700 (PDT)\r
+From: Jameson Graef Rollins <jrollins@finestructure.net>\r
+To: Notmuch Mail <notmuch@notmuchmail.org>\r
+Subject: [PATCH] emacs: process crypto for reply only when specified\r
+Date: Sun,  6 Apr 2014 23:40:14 -0700\r
+Message-Id: <1396852814-10338-1-git-send-email-jrollins@finestructure.net>\r
+X-Mailer: git-send-email 1.9.1\r
+In-Reply-To: <1396689486-19232-1-git-send-email-jani@nikula.org>\r
+References: <1396689486-19232-1-git-send-email-jani@nikula.org>\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Mon, 07 Apr 2014 06:40:21 -0000\r
+\r
+This is a tweak to patch "emacs: sign/encrypt replies to\r
+signed/encrypted messages" to only add mml crypto flags for replys\r
+when crypto processing has been activated.\r
+\r
+---\r
+\r
+Thanks to mjw1009 for implementation suggestions.\r
+\r
+Jani, you might consider squashing this with your original for a v2.\r
+Pushing them separately seems fine to me as well.\r
+\r
+jamie.\r
+\r
+---\r
+ emacs/notmuch-mua.el | 6 ++++--\r
+ 1 file changed, 4 insertions(+), 2 deletions(-)\r
+\r
+diff --git a/emacs/notmuch-mua.el b/emacs/notmuch-mua.el\r
+index 9fb84b5..bf6253f 100644\r
+--- a/emacs/notmuch-mua.el\r
++++ b/emacs/notmuch-mua.el\r
+@@ -160,9 +160,10 @@ list."\r
\r
+ (defun notmuch-mua-reply (query-string &optional sender reply-all)\r
+   (let ((args '("reply" "--format=sexp" "--format-version=1"))\r
++      (process-crypto notmuch-show-process-crypto)\r
+       reply\r
+       original)\r
+-    (when notmuch-show-process-crypto\r
++    (when process-crypto\r
+       (setq args (append args '("--decrypt"))))\r
\r
+     (if reply-all\r
+@@ -236,7 +237,8 @@ list."\r
+       (message-cite-original)))\r
\r
+     ;; Sign and/or encrypt replies to signed and/or encrypted messages.\r
+-    (notmuch-mua-reply-crypto (plist-get original :body)))\r
++    (when process-crypto\r
++      (notmuch-mua-reply-crypto (plist-get original :body))))\r
\r
+   ;; Push mark right before signature, if any.\r
+   (message-goto-signature)\r
+-- \r
+1.9.1\r
+\r