]> git.eshelyaron.com Git - emacs.git/commitdiff
pinentry.el: Add debugging support
authorDaiki Ueno <ueno@gnu.org>
Wed, 19 Aug 2015 02:40:17 +0000 (11:40 +0900)
committerDaiki Ueno <ueno@gnu.org>
Wed, 19 Aug 2015 02:40:44 +0000 (11:40 +0900)
* lisp/net/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.

lisp/net/pinentry.el

index d7161bbf44dac43df22a9b0808f40f33b8cdf501..eaa9fa40b12b615a776a7a6ca11ae201c2748c3b 100644 (file)
@@ -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)))
     (save-excursion
       (goto-char (point-max))
       (insert input)