[PATCH] Add inside-Emacs mode to GUI pinentry programs

Neal H. Walfield neal at walfield.org
Fri Jun 12 13:36:22 CEST 2015

At Fri, 12 Jun 2015 20:15:25 +0900,
Daiki Ueno wrote:
> "Neal H. Walfield" <neal at walfield.org> writes:
> >> I postpone this for now, since it turned out that it requires a change
> >> in GnuPG.
> >
> > Is any change actually required on the pinentry side?  If gpg-agent
> > doesn't pass the INSIDE_EMACS environment variable through, then emacs
> > support is automatically disabled.
> INSIDE_EMACS is a standardized variable, which is also set by
> shell-mode, eshell, tramp, etc., as well as epg.el and pinentry.el.
> With the patch, those major-modes will also benefit, while some users
> don't want to enable the feature automatically.  So I think a separate
> option is inevitable here.

I'm not sure what you mean.

Let me be more specific.

1./ Your last patch adds a new option to gpg-agent:
allow-emacs-pinentry.  If this is not set, then the emacs pinentry
shouldn't be used.

2./ gpg-agent controls what environment variables are passed to the
pinentry.  See agent/call-pinentry.c:atfork_cb.

3./ Your patch only uses the emacs pinentry if the INSIDE_EMACS
environment variable is set.

Thus, if allow-emacs-pinentry is not set (1) and we don't forward the
INSIDE_EMACS environment variable (2), then pinentry won't try the
emacs pinentry (3).

Therefore, teaching pinentry about this option is not required.

Does that make sense or do you have another use case in mind that I'm


:) Neal

More information about the Gnupg-devel mailing list