* pgg.el (pgg-insert-url-with-program): Call program asynchronously.
authorueno <ueno>
Fri, 5 Nov 1999 08:13:22 +0000 (08:13 +0000)
committerueno <ueno>
Fri, 5 Nov 1999 08:13:22 +0000 (08:13 +0000)
pgg.el

diff --git a/pgg.el b/pgg.el
index fea5d1c..9d8ac6e 100644 (file)
--- a/pgg.el
+++ b/pgg.el
@@ -269,9 +269,19 @@ and END to the keyring.")
 (defun pgg-insert-url-with-program (url)
   (let ((args (copy-sequence pgg-insert-url-extra-arguments))
        process)
-    (setq process 
-         (apply #'call-process pgg-insert-url-program nil t
-                (nconc args (list url))))))
+    (insert
+     (with-temp-buffer
+       (setq process 
+            (apply #'start-process " *PGG url*" (current-buffer)
+                   pgg-insert-url-program (nconc args (list url))))
+       (set-process-sentinel process #'ignore)
+       (while (eq 'run (process-status process))
+        (accept-process-output process 5))
+       (delete-process process)
+       (if (and process (eq 'run (process-status process)))
+          (interrupt-process process))
+       (buffer-string)))
+    ))
 
 (defun pgg-fetch-key (keyserver key)
   "Attempt to fetch a key for addition to PGP or GnuPG keyring."