New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
What's the difference between in-buffer-source and sync-source? #1789
Comments
Chunyang Xu <notifications@github.com> writes:
https://github.com/emacs-helm/helm/wiki/Developing#creating-a-source says:
+ helm-source-sync, which puts candidates in a list.
+ helm-source-in-buffer, which puts candidates in a buffer.
what does it mean for someone who is going to make a new command with helm? what's the advantage that in-buffer source can provide and how to make use of it?
The helm wiki provides two example uses for them, they are achieving the same purpose, so it doesn't help me understand the difference:
(helm-build-sync-source "test"
:candidates '(a b c d e))
Here helm goes in the list generated by :candidates and compares one by
one candidates with string-match, when candidate match helm put it in
helm-buffer.
+ Allow modifying list of candidates dynamically while user type in
pattern.
- Slow.
(helm-build-in-buffer-source "test1"
:data '(a b c d e))
Here helm store candidates generated by :data in a special buffer
generated with helm-candidate-buffer and search (re-search-forward) in
this buffer for candidates matching pattern and put them in helm-buffer.
+ Much faster.
- Support only a fixed list of candidates generated on start.
HTH.
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.*
--
Thierry
Gpg Key fingerprint = 6CEC 7081 AB33 E251 4AB8 5FC2 28D1 7F53 59F2 9997
|
you meant with (helm :sources
(helm-build-sync-source "test1"
:volatile t
:candidates
(lambda ()
(list 1 2 helm-pattern)))) So If I don't need to update the candidate list once it's created, I should use in-buffer source because it is faster, otherwise, I should use sync source. |
Chunyang Xu <notifications@github.com> writes:
+ Allow modifying list of candidates dynamically while user type in
pattern.
you meant with :volatile t?
Yes.
for example,
(helm :sources
(helm-build-sync-source "test1"
:volatile t
:candidates
(lambda ()
(list 1 2 helm-pattern))))
So If I don't need to update the candidate list once it's created, I
should use in-buffer source because it is faster, otherwise, I should
use sync source.
Yes.
…--
Thierry
Gpg Key fingerprint = 6CEC 7081 AB33 E251 4AB8 5FC2 28D1 7F53 59F2 9997
|
Thanks for your explanation, it is helpful. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/emacs-helm/helm/wiki/Developing#creating-a-source says:
what does it mean for someone who is going to make a new command with helm? what's the advantage that in-buffer source can provide and how to make use of it?
The helm wiki provides two example uses for them, they are achieving the same purpose, so it doesn't help me understand the difference:
The text was updated successfully, but these errors were encountered: