emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master cfacb75 1/2: epg: don't start pinentry if it is use


From: Daiki Ueno
Subject: [Emacs-diffs] master cfacb75 1/2: epg: don't start pinentry if it is useless
Date: Thu, 9 Jun 2016 08:56:47 +0000 (UTC)

branch: master
commit cfacb7547d0f99c3c186a1c1ebb84ce42a04a428
Author: Daiki Ueno <address@hidden>
Commit: Daiki Ueno <address@hidden>

    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.
---
 lisp/epg.el |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/lisp/epg.el b/lisp/epg.el
index f4058ed..d37db11 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]