* epa.el (epa-select-keys): If SECRET is specified, select a
authorueno <ueno>
Sat, 1 Jul 2006 11:21:51 +0000 (11:21 +0000)
committerueno <ueno>
Sat, 1 Jul 2006 11:21:51 +0000 (11:21 +0000)
primary secret key by default.
This commit is a result of hacks at the CodeFest Akihabara 2006 hosted by FSIJ.

ChangeLog
epa.el

index 6bbb536..e1a2aab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2006-07-01  Daiki Ueno  <ueno@unixuser.org>
+
+       * epa.el (epa-select-keys): If SECRET is specified, select a
+       primary secret key by default.
+
 2006-06-29  Daiki Ueno  <ueno@unixuser.org>
 
        * EasyPG: Version 0.0.3 released.
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))