* epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer.
authorDaiki Ueno <ueno@gnu.org>
Fri, 21 Dec 2012 07:21:35 +0000 (16:21 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 21 Dec 2012 07:21:35 +0000 (16:21 +0900)
lisp/ChangeLog
lisp/epg.el

index a26fc63..d3c83e7 100644 (file)
@@ -1,3 +1,7 @@
+2012-12-21  Daiki Ueno  <ueno@gnu.org>
+
+       * epg.el (epg--start): Print GPG_AGENT_INFO in the debug buffer.
+
 2012-12-21  Chong Yidong  <cyd@gnu.org>
 
        * simple.el (transpose-subr-1): Preserve marker positions by
index b0e01bc..ea97ddd 100644 (file)
@@ -1130,12 +1130,12 @@ This function is for internal use only."
             (if (eq (epg-context-protocol context) 'CMS)
                 epg-gpgsm-program
               epg-gpg-program)))
-  (let* ((args (append (list "--no-tty"
+  (let* ((agent-info (getenv "GPG_AGENT_INFO"))
+        (args (append (list "--no-tty"
                             "--status-fd" "1"
                             "--yes")
                       (if (and (not (eq (epg-context-protocol context) 'CMS))
-                               (string-match ":" (or (getenv "GPG_AGENT_INFO")
-                                                     "")))
+                               (string-match ":" (or agent-info "")))
                           '("--use-agent"))
                       (if (and (not (eq (epg-context-protocol context) 'CMS))
                                (epg-context-progress-callback context))
@@ -1161,7 +1161,10 @@ This function is for internal use only."
            (setq epg-debug-buffer (generate-new-buffer " *epg-debug*")))
          (set-buffer epg-debug-buffer)
          (goto-char (point-max))
-         (insert (format "%s %s\n"
+         (insert (if agent-info
+                     (format "GPG_AGENT_INFO=%s\n" agent-info)
+                   "GPG_AGENT_INFO is not set\n")
+                 (format "%s %s\n"
                          (if (eq (epg-context-protocol context) 'CMS)
                              epg-gpgsm-program
                           epg-gpg-program)