* pgg-epg.el (pgg-epg-sign-region): Select the signing key matched
[elisp/epg.git] / epa.el
diff --git a/epa.el b/epa.el
index 7596176..aae2313 100644 (file)
--- a/epa.el
+++ b/epa.el
@@ -388,7 +388,13 @@ If SECRET is non-nil, list secret keys instead of public keys."
            (epa-mark)
            (goto-char (point-max))
            (setq names (cdr names)))
-       (epa-insert-keys context nil secret))
+       (if secret
+           (progn
+             (setq point (point))
+             (epa-insert-keys context nil secret)
+             (goto-char point)
+             (epa-mark))
+         (epa-insert-keys context nil nil)))
       (epa-keys-mode)
       (setq epa-exit-buffer-function #'abort-recursive-edit)
       (goto-char (point-min))
@@ -401,12 +407,6 @@ If SECRET is non-nil, list secret keys instead of public keys."
            (delete-window (get-buffer-window epa-keys-buffer)))
        (kill-buffer epa-keys-buffer))))
 
-(defun epa--format-seconds (seconds)
-  (let ((number-seconds (string-to-number (concat seconds ".0"))))
-    (format-time-string "%Y-%m-%d"
-                       (cons (floor (/ number-seconds 65536))
-                             (floor (mod number-seconds 65536))))))
-
 (defun epa-show-key (key)
   (let* ((primary-sub-key (car (epg-key-sub-key-list key)))
         (entry (assoc (epg-sub-key-id primary-sub-key)
@@ -456,11 +456,13 @@ 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: "
-             (epa--format-seconds (epg-sub-key-creation-time (car pointer)))
+             (format-time-string "%Y-%m-%d"
+                                 (epg-sub-key-creation-time (car pointer)))
              (if (epg-sub-key-expiration-time (car pointer))
                  (format "\n\tExpires: %s"
-                         (epa--format-seconds (epg-sub-key-expiration-time
-                                               (car pointer))))
+                         (format-time-string "%Y-%m-%d"
+                                             (epg-sub-key-expiration-time
+                                              (car pointer))))
                "")
              "\n\tCapabilities: "
              (mapconcat #'symbol-name
@@ -596,7 +598,7 @@ If no one is selected, default secret key is used.  "
   "Encrypt FILE for RECIPIENTS."
   (interactive
    (list (expand-file-name (read-file-name "File: "))
-        (epa-select-keys (epg-make-context) "Select recipents for encryption.
+        (epa-select-keys (epg-make-context) "Select recipients for encryption.
 If no one is selected, symmetric encryption will be performed.  ")))
   (let ((cipher (concat file (if epa-armor ".asc" ".gpg")))
        (context (epg-make-context)))
@@ -732,7 +734,7 @@ If no one is selected, default secret key is used.  "
 Don't use this command in Lisp programs!"
   (interactive
    (list (region-beginning) (region-end)
-        (epa-select-keys (epg-make-context) "Select recipents for encryption.
+        (epa-select-keys (epg-make-context) "Select recipients for encryption.
 If no one is selected, symmetric encryption will be performed.  ")))
   (save-excursion
     (let ((context (epg-make-context))