Quantcast

emacs: use epg-gpg-program

classic Classic list List threaded Threaded
4 messages Options
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

emacs: use epg-gpg-program

From: John Byrnes <[hidden email]>

From: John Byrnes <[hidden email]>

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:[hidden email] with a shorter subject line.

To me this patch LGTM.

In comparison to id:[hidden email] , 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))'
gpg2

 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))
     (notmuch-show-refresh-view)))
 
--
2.10.0

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: emacs: use epg-gpg-program

Tomi Ollila <[hidden email]> writes:

> From: John Byrnes <[hidden email]>
>
> From: John Byrnes <[hidden email]>
>
> 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.

Following Tomi's hint on IRC I ran

emacs -Q --batch --eval "(progn (package-initialize) (require 'notmuch) (message epg-gpg-program))"

and it seems epg-gpg-program is defined. On the other hand can anyone
think of a good reason not to add (require 'epg) to the top of
notmuch-crypto.el?

d

_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Tomi Ollila-2 Tomi Ollila-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: emacs: use epg-gpg-program

On Mon, Mar 13 2017, David Bremner <[hidden email]> wrote:

> Tomi Ollila <[hidden email]> writes:
>
>> From: John Byrnes <[hidden email]>
>>
>> From: John Byrnes <[hidden email]>
>>
>> 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.
>
> Following Tomi's hint on IRC I ran
>
> emacs -Q --batch --eval "(progn (package-initialize) (require 'notmuch) (message epg-gpg-program))"
>
> and it seems epg-gpg-program is defined. On the other hand can anyone
> think of a good reason not to add (require 'epg) to the top of
> notmuch-crypto.el?

IMO amending one From: line out and adding that is a good idea,
to explicitly require a module which feature is being used.

Currently it looks like egp is loaded by mml-sec, which is loaded by
mml-smime which is loaded by mm-view which is loaded by notmuch.el as the
first module it is requiring (used try-emacs-mua to see what it is loading
and then manually parsed the output)


Tomi

>
> d
_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
David Bremner-2 David Bremner-2
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: emacs: use epg-gpg-program

Tomi Ollila <[hidden email]> writes:

> IMO amending one From: line out and adding that is a good idea, to
> explicitly require a module which feature is being used.

Done, and pushed.  Thanks to you both for your contribution.

d


_______________________________________________
notmuch mailing list
[hidden email]
https://notmuchmail.org/mailman/listinfo/notmuch
Loading...