* epg-package-info.el.in (epg-bug-report-address): New constant.
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index 57dcb70..8c7305b 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -55,9 +55,9 @@ the separate window."
                        '(:weight bold)
                      '(:bold t))))
     (t
-     ,@(if (assq ':weight custom-face-attributes)
-          '(:weight bold)
-        '(:bold t))))
+     (,@(if (assq ':weight custom-face-attributes)
+           '(:weight bold)
+         '(:bold t)))))
   "Face used for displaying the high validity."
   :group 'epa-faces)
 
@@ -156,18 +156,16 @@ the separate window."
     (full . epa-validity-high)
     (ultimate . epa-validity-high))
   "An alist mapping validity values to faces."
-  :type 'list
+  :type '(repeat (cons symbol face))
   :group 'epa)
 
-(defcustom epa-font-lock-keywords
+(defvar epa-font-lock-keywords
   '(("^\\*"
      (0 'epa-mark))
     ("^\t\\([^\t:]+:\\)[ \t]*\\(.*\\)$"
      (1 'epa-field-name)
      (2 'epa-field-body)))
-  "Default expressions to addon in epa-mode."
-  :type '(repeat (list string))
-  :group 'epa)
+  "Default expressions to addon in epa-mode.")
 
 (defconst epa-pubkey-algorithm-letter-alist
   '((1 . ?R)
@@ -573,13 +571,17 @@ If SECRET is non-nil, list secret keys instead of public keys."
              (cdr (assq (epg-sub-key-algorithm (car pointer))
                         epg-pubkey-algorithm-alist))
              "\n\tCreated: "
-             (format-time-string "%Y-%m-%d"
-                                 (epg-sub-key-creation-time (car pointer)))
+             (condition-case nil
+                 (format-time-string "%Y-%m-%d"
+                                     (epg-sub-key-creation-time (car pointer)))
+               (error "????-??-??"))
              (if (epg-sub-key-expiration-time (car pointer))
                  (format "\n\tExpires: %s"
-                         (format-time-string "%Y-%m-%d"
-                                             (epg-sub-key-expiration-time
-                                              (car pointer))))
+                         (condition-case nil
+                             (format-time-string "%Y-%m-%d"
+                                                 (epg-sub-key-expiration-time
+                                                  (car pointer)))
+                           (error "????-??-??")))
                "")
              "\n\tCapabilities: "
              (mapconcat #'symbol-name
@@ -858,23 +860,28 @@ Don't use this command in Lisp programs!"
     (epg-context-set-progress-callback context
                                       #'epa-progress-callback-function
                                       "Verifying...")
+    (message "Verifying...")
     (setq plain (epg-verify-string
                 context
                 (epa--encode-coding-string
                  (buffer-substring start end)
                  (or coding-system-for-write
-                     (get-text-property start
-                                        'epa-coding-system-used)))))
+                     (get-text-property start 'epa-coding-system-used)))))
+    (message "Verifying...done")
+    (setq plain (epa--decode-coding-string
+                plain
+                (or coding-system-for-read
+                    (get-text-property start 'epa-coding-system-used))))
     (if (y-or-n-p "Replace the original text? ")
        (let ((inhibit-read-only t)
              buffer-read-only)
          (delete-region start end)
          (goto-char start)
          (insert plain))
-       (with-output-to-temp-buffer "*Temp*"
-         (set-buffer standard-output)
-         (insert plain)
-         (epa-info-mode)))
+      (with-output-to-temp-buffer "*Temp*"
+       (set-buffer standard-output)
+       (insert plain)
+       (epa-info-mode)))
     (if (epg-context-result-for context 'verify)
        (epa-display-info (epg-verify-result-to-string
                           (epg-context-result-for context 'verify))))))