From 08667d9c7d988746b6259b81200cff8290d6f1b7 Mon Sep 17 00:00:00 2001 From: Jethro Kuan Date: Mon, 16 Mar 2020 13:00:12 +0800 Subject: [PATCH] (bugfix): Fix Helm integration for completing-read (#306) Fixes #304, using PR #305 as the base, thanks @khinsen --- org-roam.el | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/org-roam.el b/org-roam.el index 7592056..f74a4e8 100644 --- a/org-roam.el +++ b/org-roam.el @@ -651,7 +651,7 @@ https://github.com/abo-abo/swiper"))) (user-error "Please install helm from \ https://github.com/emacs-helm/helm")) (let ((source (helm-build-sync-source prompt - :candidates choices + :candidates (mapcar #'car choices) :filtered-candidate-transformer (and (not require-match) #'org-roam---helm-candidate-transformer) @@ -659,14 +659,15 @@ https://github.com/emacs-helm/helm")) (buf (concat "*org-roam " (s-downcase (s-chop-suffix ":" (s-trim prompt))) "*"))) - (helm :sources source - :action (if action - (prog1 action - (setq action nil)) - #'identity) - :prompt prompt - :input initial-input - :buffer buf))))) + (or (helm :sources source + :action (if action + (prog1 action + (setq action nil)) + #'identity) + :prompt prompt + :input initial-input + :buffer buf) + (keyboard-quit)))))) (if action (funcall action res) res)))