* 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 27b0dc0..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))