[PATCH v1 3/4] emacs: Add notmuch-crypto-gpg-program and use it

David Edmondson dme at dme.org
Tue Sep 4 06:28:42 PDT 2018


Allow the user to specify the gpg program to use when retriving keys,
etc., defaulting to the value of `epg-gpg-program'.
---
 emacs/notmuch-crypto.el | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index cd918df3..5298d1ef 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -48,6 +48,11 @@ mode."
   :type 'boolean
   :group 'notmuch-crypto)
 
+(defcustom notmuch-crypto-gpg-program epg-gpg-program
+  "The gpg executable."
+  :type 'string
+  :group 'notmuch-crypto)
+
 (defface notmuch-crypto-part-header
   '((((class color)
       (background dark))
@@ -149,7 +154,7 @@ by user FROM."
     (with-selected-window window
       (with-current-buffer buffer
 	(goto-char (point-max))
-	(call-process epg-gpg-program nil t t "--list-keys" fingerprint))
+	(call-process notmuch-crypto-gpg-program nil t t "--list-keys" fingerprint))
       (recenter -1))))
 
 (declare-function notmuch-show-refresh-view "notmuch-show" (&optional reset-state))
@@ -190,7 +195,7 @@ corresponding key when the status button is pressed."
     (if notmuch-crypto-get-keys-asynchronously
 	(let ((p (make-process :name "notmuch GPG key retrieval"
 			       :buffer buffer
-			       :command (list epg-gpg-program "--recv-keys" keyid)
+			       :command (list notmuch-crypto-gpg-program "--recv-keys" keyid)
 			       :connection-type 'pipe
 			       :sentinel #'notmuch-crypto--async-key-sentinel
 			       ;; Create the process stopped so that
@@ -207,9 +212,9 @@ corresponding key when the status button is pressed."
 	(with-selected-window window
 	  (with-current-buffer buffer
 	    (goto-char (point-max))
-	    (call-process epg-gpg-program nil t t "--recv-keys" keyid)
+	    (call-process notmuch-crypto-gpg-program nil t t "--recv-keys" keyid)
 	    (insert "\n")
-	    (call-process epg-gpg-program nil t t "--list-keys" keyid))
+	    (call-process notmuch-crypto-gpg-program nil t t "--list-keys" keyid))
 	  (recenter -1))
 	(notmuch-show-refresh-view)))))
 
-- 
2.11.0



More information about the notmuch mailing list