* epg.el (epg-start): Signal an error if the process of CONTEXT is
authorueno <ueno>
Mon, 1 May 2006 00:53:21 +0000 (00:53 +0000)
committerueno <ueno>
Mon, 1 May 2006 00:53:21 +0000 (00:53 +0000)
already running for other operations.

ChangeLog
epg.el

index 78c58cc..5c69ecc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-05-01  Daiki Ueno  <ueno@unixuser.org>
+
+       * epg.el (epg-start): Signal an error if the process of CONTEXT is
+       already running for other operations.
+
 2006-04-30  Daiki Ueno  <ueno@unixuser.org>
 
        * epa.el (epa-delete-keys): Support deletion of secret keys.
diff --git a/epg.el b/epg.el
index 94767c1..376a674 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -613,6 +613,11 @@ This function is for internal use only."
 
 (defun epg-start (context args)
   "Start `epg-gpg-program' in a subprocess with given ARGS."
+  (if (eq (process-status (epg-context-process context)) 'run)
+      (error "%s is already running in this context"
+            (if (eq (epg-context-protocol context) 'CMS)
+                epg-gpgsm-program
+              epg-gpg-program)))
   (let* ((args (append (list "--no-tty"
                             "--status-fd" "1"
                             "--yes")