* epg.el (epg-signature-to-string): New function.
authorueno <ueno>
Thu, 20 Apr 2006 04:11:39 +0000 (04:11 +0000)
committerueno <ueno>
Thu, 20 Apr 2006 04:11:39 +0000 (04:11 +0000)
ChangeLog
epa.el
epg.el

index eb4fb26..d8e1507 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2006-04-20  Daiki Ueno  <ueno@unixuser.org>
 
+       * epg.el (epg-signature-to-string): New function.
+
+2006-04-20  Daiki Ueno  <ueno@unixuser.org>
+
        * epa-file.el (epa-file-write-region): RECIPIENTS is now a list of
        key objects.
        * epa-dired.el (epa-dired-do-encrypt): RECIPIENTS is now a list of
diff --git a/epa.el b/epa.el
index 87ed7b5..6549e40 100644 (file)
--- a/epa.el
+++ b/epa.el
     (message "Verifying %s..." (file-name-nondirectory file))
     (epg-verify-file context file plain)
     (message "Verifying %s...done" (file-name-nondirectory file))
-    (setq signature (reverse (epg-context-result-for context 'verify)))
-    (while signature
-      (message "%s: %s %s %s"
-              (epg-signature-status (car signature))
-              (epg-signature-key-id (car signature))
-              (epg-signature-user-id (car signature))
-              (epg-signature-validity (car signature)))
-      (setq signature (cdr signature)))))
+    (message "%s"
+            (mapconcat #'epg-signature-to-string
+                       (reverse (epg-context-result-for context 'verify))
+                       "\n"))))
 
 (defun epa-sign-file (file detached)
   (interactive
diff --git a/epg.el b/epg.el
index d1d9160..486ab79 100644 (file)
--- a/epg.el
+++ b/epg.el
@@ -406,6 +406,16 @@ This function is for internal use only."
        (setcdr entry value)
       (epg-context-set-result context (cons (cons name value) result)))))
 
+(defun epg-signature-to-string (signature)
+  (format "%s signature from %s %s%s"
+         (capitalize (symbol-name (epg-signature-status signature)))
+         (epg-signature-key-id signature)
+         (epg-signature-user-id signature)
+         (if (epg-signature-validity signature)
+             (format " (trust %s)"
+                     (epg-signature-validity signature))
+           "")))
+
 (defun epg-start (context args)
   "Start `epg-gpg-program' in a subprocess with given ARGS."
   (let* ((args (append (list "--no-tty"