minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.25k stars 105 forks source link

Is there any mechanism like :dynamic-collection of counsel in consult? #590

Closed liuyinz closed 2 years ago

liuyinz commented 2 years ago

@minad I am a fan of counsel-jq, how should I implement consult-jq with mechanism like :dynamic-collection in consult? Using async or something else, no idea still. Any advice, thanks!

minad commented 2 years ago

There are two ways. You can either use consult--read with async (see for example consult-ripgrep, consult-find, consult-notmuch, consult-spotify, affe, ...).

Alternatively you could rely on the (non-Consult!) synchronous completion-table-dynamic (see https://github.com/minad/vertico/#completion-table-dynamic). See also @alphapapa's org-ql-find which uses a dynamic completion function https://github.com/alphapapa/org-ql/commit/d0acc8cbba63ef50f1c0ecffdf1770792b13592d. See also the discussion and the issue there.