2007-03-26 Daiki Ueno <ueno@unixuser.org>
- * epa.el (epa--insert-keys): Changed arglist. All callers changed.
+ * epa.el (epa--insert-keys): Changed arglist. All callers
+ changed.
+ (epa--select-keys): New function.
+ (epa-select-keys): Use it; don't popup menu if keys have elements
+ less than 2.
2007-03-25 Daiki Ueno <ueno@unixuser.org>
(if key
(list key))))))
-;;;###autoload
-(defun epa-select-keys (context prompt &optional names secret)
- "Display a user's keyring and ask him to select keys.
-CONTEXT is an epg-context.
-PROMPT is a string to prompt with.
-NAMES is a list of strings to be matched with keys. If it is nil, all
-the keys are listed.
-If SECRET is non-nil, list secret keys instead of public keys."
+(defun epa--select-keys (prompt keys)
(save-excursion
(unless (and epa-keys-buffer
(buffer-live-p epa-keys-buffer))
"Click here or \\[exit-recursive-edit] to finish")
"OK")
(insert "\n\n")
- (epa--insert-keys (epg-list-keys context name secret))
+ (epa--insert-keys keys)
(widget-setup)
(set-keymap-parent (current-local-map) widget-keymap)
(setq epa-exit-buffer-function #'abort-recursive-edit)
(delete-window (get-buffer-window epa-keys-buffer)))
(kill-buffer epa-keys-buffer))))
+;;;###autoload
+(defun epa-select-keys (context prompt &optional names secret)
+ "Display a user's keyring and ask him to select keys.
+CONTEXT is an epg-context.
+PROMPT is a string to prompt with.
+NAMES is a list of strings to be matched with keys. If it is nil, all
+the keys are listed.
+If SECRET is non-nil, list secret keys instead of public keys."
+ (let ((keys (epg-list-keys context name secret)))
+ (if (> (length keys) 1)
+ (epa--select-keys prompt keys)
+ keys)))
+
(defun epa--format-fingerprint-1 (fingerprint unit-size block-size)
(let ((unit 0))
(with-temp-buffer