-(defun epa--insert-keys (context name mode)
- (save-excursion
- (save-restriction
- (narrow-to-region (point) (point))
- (let ((keys (epg-list-keys context name mode))
- point)
- (while keys
- (setq point (point))
- (insert " ")
- (add-text-properties point (point)
- (list 'epa-key (car keys)
- 'front-sticky nil
- 'rear-nonsticky t
- 'start-open t
- 'end-open t))
- (widget-create 'epa-key :value (car keys))
- (insert "\n")
- (setq keys (cdr keys))))
- (add-text-properties (point-min) (point-max)
- (list 'epa-list-keys t
- 'front-sticky nil
- 'rear-nonsticky t
- 'start-open t
- 'end-open t)))))
+;;;###autoload
+(defun epa-list-keys (&optional name)
+ "List all keys matched with NAME from the public keyring."
+ (interactive
+ (if current-prefix-arg
+ (let ((name (read-string "Pattern: "
+ (if epa-list-keys-arguments
+ (car epa-list-keys-arguments)))))
+ (list (if (equal name "") nil name)))
+ (list nil)))
+ (epa--list-keys name nil))
+
+;;;###autoload
+(defun epa-list-secret-keys (&optional name)
+ "List all keys matched with NAME from the private keyring."
+ (interactive
+ (if current-prefix-arg
+ (let ((name (read-string "Pattern: "
+ (if epa-list-keys-arguments
+ (car epa-list-keys-arguments)))))
+ (list (if (equal name "") nil name)))
+ (list nil)))
+ (epa--list-keys name t))
+
+(defun epa--key-list-revert-buffer (&optional ignore-auto noconfirm)
+ (apply #'epa--list-keys epa-list-keys-arguments))