1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2025-02-04 20:27:45 +00:00

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.
This commit is contained in:
Daiki Ueno 2016-06-09 17:23:38 +09:00
parent 82f49c6a37
commit cfacb7547d

View File

@ -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