aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaiki Ueno2016-06-09 17:23:38 +0900
committerDaiki Ueno2016-06-09 17:26:56 +0900
commitcfacb7547d0f99c3c186a1c1ebb84ce42a04a428 (patch)
tree5cf3b3329dc9592cc6114ec10a3298ac8a7eeb11
parent82f49c6a373f981a778f4d939ca2d47c031e0659 (diff)
downloademacs-cfacb7547d0f99c3c186a1c1ebb84ce42a04a428.tar.gz
emacs-cfacb7547d0f99c3c186a1c1ebb84ce42a04a428.zip
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.
-rw-r--r--lisp/epg.el8
1 files changed, 6 insertions, 2 deletions
diff --git a/lisp/epg.el b/lisp/epg.el
index f4058ed35a4..d37db110be6 100644
--- a/lisp/epg.el
+++ b/lisp/epg.el
@@ -604,9 +604,13 @@ callback data (if any)."
604 (setq process-environment 604 (setq process-environment
605 (cons (concat "GPG_TTY=" terminal-name) 605 (cons (concat "GPG_TTY=" terminal-name)
606 (cons "TERM=xterm" process-environment)))) 606 (cons "TERM=xterm" process-environment))))
607 ;; Start the Emacs Pinentry server if allow-emacs-pinentry is set 607 ;; Automatically start the Emacs Pinentry server if appropriate.
608 ;; in ~/.gnupg/gpg-agent.conf.
609 (when (and (fboundp 'pinentry-start) 608 (when (and (fboundp 'pinentry-start)
609 ;; Emacs Pinentry is useless if Emacs has no interactive session.
610 (not noninteractive)
611 ;; Prefer pinentry-mode over Emacs Pinentry.
612 (null (epg-context-pinentry-mode context))
613 ;; Check if the allow-emacs-pinentry option is set.
610 (executable-find epg-gpgconf-program) 614 (executable-find epg-gpgconf-program)
611 (with-temp-buffer 615 (with-temp-buffer
612 (when (= (call-process epg-gpgconf-program nil t nil 616 (when (= (call-process epg-gpgconf-program nil t nil