Subject: Re: bug#31603: 27.0.50; pinentry loopback disappeared

From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 26 May 2018 12:14:13 +0100

<[email-masked]> writes:

> With 'allow-loopback-pinentry' in gpg-agent.conf and (setq
> epa-pinentry-mode 'loopback) in .emacs, I enjoy reliable pass-phrase
> prompting and entering in the Emacs minibuffer for quite some time (at
> least since September 2016).
>
> Now unexpectedly, pinentry-curses started to pop-up for pass-phrase
> prompting. I suspect commit 302e500087fd4cc1c5f37ec87c98e828b22aaa05
> being the cause. I did not find a way to get pinentry-loopback back and
> working.

Have you tried replacing (setq epa-pinentry-mode 'loopback) with
(setq epg-pinentry-mode 'loopback)?  If doing this solves your issue,
then I think the problem with the referenced commit [1: 302e500087] is
that it uses define-obsolete-variable-alias (see docstring) in epa.el
after epg-pinentry-mode has already been defined in epg-config.el.

[1: 302e500087]: 2018-05-23 07:53:58 -0400
  Move epa-pinentry-mode to epg-config (Bug#26298)
  https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=302e500087fd4cc1c5f37ec87c98e828b22aaa05

In other words, should we do the following?

>From e0577acadc471ffe64fb31a2a3ea457046cf1944 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email-masked]>
Date: Sat, 26 May 2018 12:09:15 +0100
Subject: [PATCH] Place epg-pinentry-mode varalias before defcustom

* lisp/epa.el (epa-pinentry-mode):
Move obsolete varalias from here...
* lisp/epg-config.el (epg-pinentry-mode): ...to here. (bug#31603)
---
 lisp/epa.el        | 3 ---
 lisp/epg-config.el | 2 ++
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/lisp/epa.el b/lisp/epa.el
index 16621659a6..c3938e90a7 100644
--- a/lisp/epa.el
+++ b/lisp/epa.el
@@ -56,9 +56,6 @@ epa-info-window-height
   :type 'integer
   :group 'epa)
 
-(define-obsolete-variable-alias
-  'epa-pinentry-mode 'epg-pinentry-mode "27.1")
-
 (defgroup epa-faces nil
   "Faces for epa-mode."
   :version "23.1"
diff --git a/lisp/epg-config.el b/lisp/epg-config.el
index 9d9bd7101e..98f458d996 100644
--- a/lisp/epg-config.el
+++ b/lisp/epg-config.el
@@ -69,6 +69,8 @@ epg-passphrase-coding-system
   "Coding system to use with messages from `epg-gpg-program'."
   :type 'symbol)
 
+(define-obsolete-variable-alias
+  'epa-pinentry-mode 'epg-pinentry-mode "27.1")
 
 ;; In the doc string below, we say "symbol `error'" to avoid producing
 ;; a hyperlink for `error' the function.
-- 
2.17.0

-- 
Basil