[Top][All Lists]

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

[elpa] master 32bec2a 06/11: pinentry.el: Add debugging support

From: Nicolas Petton
Subject: [elpa] master 32bec2a 06/11: pinentry.el: Add debugging support
Date: Tue, 16 Jan 2018 08:01:45 -0500 (EST)

branch: master
commit 32bec2a359771a5813cc17d4877f9172fdc103ec
Author: Daiki Ueno <address@hidden>
Commit: Nicolas Petton <address@hidden>

    pinentry.el: Add debugging support
    * packages/pinentry/pinentry.el (pinentry-debug): New variable.
    (pinentry-debug-buffer): New variable.
    (pinentry--process-filter): Send input to the debug buffer, if
    `pinentry-debug' is set.
 packages/pinentry/pinentry.el | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/packages/pinentry/pinentry.el b/packages/pinentry/pinentry.el
index d7161bb..eaa9fa4 100644
--- a/packages/pinentry/pinentry.el
+++ b/packages/pinentry/pinentry.el
@@ -63,6 +63,8 @@
   :type 'integer
   :group 'pinentry)
+(defvar pinentry-debug nil)
+(defvar pinentry-debug-buffer nil)
 (defvar pinentry--server-process nil)
 (defvar pinentry--connection-process-list nil)
@@ -293,6 +295,13 @@ Assuan protocol."
         (setq pinentry--read-point (point-min))
         (make-local-variable 'pinentry--labels))))
   (with-current-buffer (process-buffer process)
+    (when pinentry-debug
+      (with-current-buffer
+          (or pinentry-debug-buffer
+              (setq pinentry-debug-buffer (generate-new-buffer
+                                           " *pinentry-debug*")))
+        (goto-char (point-max))
+        (insert input)))
       (goto-char (point-max))
       (insert input)

reply via email to

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