OSDN Git Service

(epg--prompt-GET_BOOL-untrusted_key.override): Lookup
authorDaiki Ueno <ueno@unixuser.org>
Thu, 26 Apr 2007 06:28:57 +0000 (06:28 +0000)
committerDaiki Ueno <ueno@unixuser.org>
Thu, 26 Apr 2007 06:28:57 +0000 (06:28 +0000)
user-id from epg-user-id-alist.

ChangeLog
epg.el

index fbf959a..cf248cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-26  Daiki Ueno  <ueno@unixuser.org>
+
+       * epg.el (epg--prompt-GET_BOOL-untrusted_key.override): Lookup
+       user-id from epg-user-id-alist.
+
 2007-04-22  Daiki Ueno  <ueno@unixuser.org>
 
        * epa-file.el (epa-file-select-keys): New command.
diff --git a/epg.el b/epg.el
index 160f911..7762285 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -1291,9 +1291,14 @@ This function is for internal use only."
     (y-or-n-p (if entry (cdr entry) (concat string "? ")))))
 
 (defun epg--prompt-GET_BOOL-untrusted_key.override (context string)
-  (y-or-n-p (if (equal (car epg-last-status) "USERID_HINT")
-               (format "Untrusted key %s.  Use anyway? "
-                       (cdr epg-last-status))
+  (y-or-n-p (if (and (equal (car epg-last-status) "USERID_HINT")
+                    (string-match "\\`\\([^ ]+\\) \\(.*\\)" string))
+               (let* ((key-id (match-string 1 string))
+                      (user-id (match-string 2 string))
+                      (entry (assoc key-id epg-user-id-alist)))
+                 (if entry
+                     (setq user-id (cdr entry)))
+                 (format "Untrusted key %s %s.  Use anyway? " key-id user-id))
              "Use untrusted key anyway? ")))
 
 (defun epg--status-GET_BOOL (context string)