(epg-delete-keys): Decode delete-problem.
authorueno <ueno>
Sun, 12 Nov 2006 05:45:49 +0000 (05:45 +0000)
committerueno <ueno>
Sun, 12 Nov 2006 05:45:49 +0000 (05:45 +0000)
ChangeLog
epg.el

index 5cfcd28..94ae19c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2006-11-12  Daiki Ueno  <ueno@unixuser.org>
 
+       * epg.el (epg-delete-keys): Decode delete-problem.
+
        * epa.el (epa-popup-info-window): Turn on by default.
        (epa-display-info): Split selected window instead of pop-to-buffer.
 
diff --git a/epg.el b/epg.el
index 18d3991..541f8f4 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -2303,11 +2303,11 @@ If you are unsure, use synchronous version of this function
   (epg--start context (cons (if allow-secret
                               "--delete-secret-key"
                             "--delete-key")
-                          (mapcar
-                           (lambda (key)
-                             (epg-sub-key-id
-                              (car (epg-key-sub-key-list key))))
-                           keys))))
+                           (mapcar
+                            (lambda (key)
+                              (epg-sub-key-id
+                               (car (epg-key-sub-key-list key))))
+                            keys))))
 
 ;;;###autoload
 (defun epg-delete-keys (context keys &optional allow-secret)
@@ -2316,9 +2316,11 @@ If you are unsure, use synchronous version of this function
       (progn
        (epg-start-delete-keys context keys allow-secret)
        (epg-wait-for-completion context)
-       (if (epg-context-result-for context 'error)
-           (error "Delete keys failed: %S"
-                  (epg-context-result-for context 'error))))
+       (let ((entry (assq 'delete-problem
+                          (epg-context-result-for context 'error))))
+         (if entry
+             (error "Delete keys failed: %s"
+                    (assq (cdr entry) epg-delete-problem-reason-alist)))))
     (epg-reset context)))
 
 ;;;###autoload