Subject: Re: bug#24553: 25.1; epa ignores epg-gpg-program in very confusing way

From: Glenn Morris <[email-masked]>
Date: Fri, 10 Mar 2017 15:16:57 -0500

Version: 26.1

[email-masked] wrote:

> However, when it fails to decrypt, it prints the message:  Error while
> decrypting with "/usr/bin/gpg1."  This is obviously very frustrating
> since gpg1 can in fact decrypt the file.  Ideally emacs should obey
> epg-gpg-program, but if it doesn't, it should properly report what
> failed.

Thanks for the report. The following improves the error message.

commit b2f20aa (HEAD, master)
Date:   Fri Mar 10 15:14:33 2017 -0500

    Small improvement for epa-display-error (bug#24553)
    
    * lisp/epa.el (epa-display-error): Report the actual program in use.

diff --git a/lisp/epa.el b/lisp/epa.el
index 4378c09..52963b6 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -628,7 +628,7 @@ If SECRET is non-nil, list secret keys instead of public keys."
 		       (`import-keys "Error while importing keys with \"%s\":")
 		       (`export-keys "Error while exporting keys with \"%s\":")
 		       (_ "Error while executing \"%s\":\n\n"))
-		     epg-gpg-program)
+		     (epg-context-program context))
 		    "\n\n"
 		    (epg-context-error-output context)))
 	  (epa-info-mode)