* epg.el (epg-list-keys): Cache user-id in epg-user-id-alist.
authorueno <ueno>
Sat, 29 Apr 2006 23:25:09 +0000 (23:25 +0000)
committerueno <ueno>
Sat, 29 Apr 2006 23:25:09 +0000 (23:25 +0000)
ChangeLog
epg.el

index d941792..32df26d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
        digest-algorithm.
        (epg-process-sentinel): Abolished.
        (epg-signature-to-string): Decode DN.
+       (epg-list-keys): Cache user-id in epg-user-id-alist.
 
 2006-04-29  Daiki Ueno  <ueno@unixuser.org>
 
diff --git a/epg.el b/epg.el
index 9e0e249..fdeb3da 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -1127,7 +1127,7 @@ If MODE is t or 'secret, only secret keyring should be searched.
 Otherwise, only public keyring should be searched and the key
 signatures should be included."
   (let ((lines (epg-list-keys-1 context name mode))
-       keys cert)
+       keys cert key-id user-id-name entry)
     (while lines
       (cond
        ((member (aref (car lines) 0) '("pub" "sec" "crt" "crs"))
@@ -1137,7 +1137,16 @@ signatures should be included."
           (nreverse (epg-key-sub-key-list (car keys))))
          (epg-key-set-user-id-list
           (car keys)
-          (nreverse (epg-key-user-id-list (car keys)))))
+          (nreverse (epg-key-user-id-list (car keys))))
+         (setq key-id
+               (epg-sub-key-id (car (epg-key-sub-key-list (car keys))))
+               user-id-name
+               (epg-user-id-name (car (epg-key-user-id-list (car keys))))
+               entry (assoc key-id epg-user-id-alist))
+         (if entry
+             (setcdr entry user-id-name)
+           (setq epg-user-id-alist (cons (cons key-id user-id-name)
+                                         epg-user-id-alist))))
        (setq cert (member (aref (car lines) 0) '("crt" "crs"))
              keys (cons (epg-make-key
                          (if (aref (car lines) 8)