(bugfix): Fix Helm integration for completing-read (#306)

Fixes #304, using PR #305 as the base, thanks @khinsen
This commit is contained in:
Jethro Kuan 2020-03-16 13:00:12 +08:00 committed by GitHub
parent f544bd9ca1
commit 08667d9c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)))