(epa--key-widget-value-create): Allow empty user IDs.
authorueno <ueno>
Tue, 14 Nov 2006 10:43:07 +0000 (10:43 +0000)
committerueno <ueno>
Tue, 14 Nov 2006 10:43:07 +0000 (10:43 +0000)
(epa--show-key): Ditto.
Reported by Werner Koch <wk@gnupg.org>.

ChangeLog
epa.el

index fc1ab05..9237c38 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-11-14  Daiki Ueno  <ueno@unixuser.org>
 
+       * epa.el (epa--key-widget-value-create): Allow empty user IDs.
+       (epa--show-key): Ditto.
+       Reported by Werner Koch <wk@gnupg.org>.
+
        * epg.el (epg--start): Don't specify --enable-progress-filter for
        gpgsm.
        (epg--status-PROGRESS): Check if progress-callback is set.
diff --git a/epa.el b/epa.el
index f021520..9731a5f 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -220,9 +220,11 @@ the separate window."
                      ? ))
            (epg-sub-key-id primary-sub-key)
            " "
-           (if (stringp (epg-user-id-string primary-user-id))
-               (epg-user-id-string primary-user-id)
-             (epg-decode-dn (epg-user-id-string primary-user-id))))))
+           (if primary-user-id
+               (if (stringp (epg-user-id-string primary-user-id))
+                   (epg-user-id-string primary-user-id)
+                 (epg-decode-dn (epg-user-id-string primary-user-id)))
+             ""))))
 
 (defun epa--key-widget-button-face-get (widget)
   (let ((validity (epg-sub-key-validity (car (epg-key-sub-key-list
@@ -465,17 +467,18 @@ If SECRET is non-nil, list secret keys instead of public keys."
     (erase-buffer)
     (setq pointer (epg-key-user-id-list key))
     (while pointer
-      (insert " "
-             (if (epg-user-id-validity (car pointer))
-                 (char-to-string
-                  (car (rassq (epg-user-id-validity (car pointer))
-                              epg-key-validity-alist)))
-               " ")
-             " "
-             (if (stringp (epg-user-id-string (car pointer)))
-                 (epg-user-id-string (car pointer))
-               (epg-decode-dn (epg-user-id-string (car pointer))))
-             "\n")
+      (if (car pointer)
+         (insert " "
+                 (if (epg-user-id-validity (car pointer))
+                     (char-to-string
+                      (car (rassq (epg-user-id-validity (car pointer))
+                                  epg-key-validity-alist)))
+                   " ")
+                 " "
+                 (if (stringp (epg-user-id-string (car pointer)))
+                     (epg-user-id-string (car pointer))
+                   (epg-decode-dn (epg-user-id-string (car pointer))))
+                 "\n"))
       (setq pointer (cdr pointer)))
     (setq pointer (epg-key-sub-key-list key))
     (while pointer