+ ;; Start the Emacs Pinentry server if allow-emacs-pinentry is set
+ ;; in ~/.gnupg/gpg-agent.conf.
+ (when (and (fboundp 'pinentry-start)
+ (executable-find epg-gpgconf-program)
+ (with-temp-buffer
+ (when (= (call-process epg-gpgconf-program nil t nil
+ "--list-options" "gpg-agent")
+ 0)
+ (goto-char (point-min))
+ (re-search-forward
+ "^allow-emacs-pinentry:\\(?:.*:\\)\\{8\\}1"
+ nil t))))
+ (pinentry-start 'quiet))
+ (setq process-environment
+ (cons (format "INSIDE_EMACS=%s,epg" emacs-version)
+ process-environment))