From: Daiki Ueno Date: Thu, 9 Jun 2016 08:23:38 +0000 (+0900) Subject: epg: don't start pinentry if it is useless X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/cfacb7547d0f99c3c186a1c1ebb84ce42a04a428 epg: don't start pinentry if it is useless * lisp/epg.el (epg--start): Don't start pinentry server if the session is non-interactive or pinentry-mode is set. --- diff --git a/lisp/epg.el b/lisp/epg.el index f4058ed35a..d37db110be 100644 --- a/lisp/epg.el +++ b/lisp/epg.el @@ -604,9 +604,13 @@ callback data (if any)." (setq process-environment (cons (concat "GPG_TTY=" terminal-name) (cons "TERM=xterm" process-environment)))) - ;; Start the Emacs Pinentry server if allow-emacs-pinentry is set - ;; in ~/.gnupg/gpg-agent.conf. + ;; Automatically start the Emacs Pinentry server if appropriate. (when (and (fboundp 'pinentry-start) + ;; Emacs Pinentry is useless if Emacs has no interactive session. + (not noninteractive) + ;; Prefer pinentry-mode over Emacs Pinentry. + (null (epg-context-pinentry-mode context)) + ;; Check if the allow-emacs-pinentry option is set. (executable-find epg-gpgconf-program) (with-temp-buffer (when (= (call-process epg-gpgconf-program nil t nil