branch: elpa/helm
commit 44a396e7a8dba7d3a62e3ed57adc37dd887313da
Author: Thierry Volpiatto <[email protected]>
Commit: Thierry Volpiatto <[email protected]>
Allow exiting from helm-epa--select-keys and ensure
to return a list of keys.
---
helm-epa.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/helm-epa.el b/helm-epa.el
index f81adea172..dc6c431e4a 100644
--- a/helm-epa.el
+++ b/helm-epa.el
@@ -86,14 +86,18 @@
uid 'face 'font-lock-warning-face))
key)))
-(defun helm-epa--select-keys (prompt keys)
+(cl-defun helm-epa--select-keys (prompt keys)
"A helm replacement for `epa--select-keys'."
(let ((result (helm :sources (helm-make-source "Epa select keys" 'helm-epa
:candidates (lambda ()
- (helm-epa-get-key-list keys)))
+ (helm-epa-get-key-list keys))
+ :action (lambda (_candidate)
+ (helm-marked-candidates)))
:prompt (and prompt (helm-epa--format-prompt prompt))
:buffer "*helm epa*")))
- (unless (equal result "")
+ (if (or (equal result "") (null result))
+ (cl-return-from helm-epa--select-keys
+ (error "No keys selected, aborting"))
result)))
(defun helm-epa--format-prompt (prompt)