emacs: use epg-gpg-program

Tomi Ollila tomi.ollila at iki.fi
Sun Mar 12 12:26:16 PDT 2017

From: John Byrnes <john at johnbyrnes.info>

From: John Byrnes <john at johnbyrnes.info>

Adjusted notmuch-crypto gpg call-process function to respect
the GPG program set by the EasyPG epg-gpg-program variable.

This is to correct a problem observed on NixOS where only gpg2 is
installed by default. The Notmuch Emacs frontend fails when trying to
access someone's key to verify their signature when it cannot find the
GPG binary.

id:878tqrpm8b.fsf at johnbyrnes.info with a shorter subject line.

To me this patch LGTM.

In comparison to id:87tw9ek798.fsf at alice.fifthhorseman.net , Fedora 25 has:

$ gpg --version
gpg (GnuPG) 1.4.21

$ gpg2 --version
gpg (GnuPG) 2.1.13

$ emacs -Q -batch --eval '(progn (require '\''epg-config) (message epg-gpg-program))'

 emacs/notmuch-crypto.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/emacs/notmuch-crypto.el b/emacs/notmuch-crypto.el
index 68a7e9f..c5111fd 100644
--- a/emacs/notmuch-crypto.el
+++ b/emacs/notmuch-crypto.el
@@ -140,7 +140,7 @@ mode."
     (with-selected-window window
       (with-current-buffer buffer
 	(goto-char (point-max))
-	(call-process "gpg" nil t t "--list-keys" fingerprint))
+	(call-process epg-gpg-program nil t t "--list-keys" fingerprint))
       (recenter -1))))
 (defun notmuch-crypto-sigstatus-error-callback (button)
@@ -151,9 +151,9 @@ mode."
     (with-selected-window window
       (with-current-buffer buffer
 	(goto-char (point-max))
-	(call-process "gpg" nil t t "--recv-keys" keyid)
+	(call-process epg-gpg-program nil t t "--recv-keys" keyid)
 	(insert "\n")
-	(call-process "gpg" nil t t "--list-keys" keyid))
+	(call-process epg-gpg-program nil t t "--list-keys" keyid))
       (recenter -1))

More information about the notmuch mailing list