Fix: (org-ql-completing-read) :query-prefix prevented selection

COMPLETING-READ, when used with its REQUIRE-MATCH argument, would not
allow a result to be selected when ORG-QL-FIND was called with its
QUERY-PREFIX argument.

This change moves where the query is modified to include the prefix,
putting it into the RUN-QUERY function instead of the COLLECTION
function.  It seems to solve the problem, and the function seems to
still work when used without QUERY-PREFIX.  However, due to the
complexity of all this (we really need a SELECTING-READ API), it
wouldn't surprise me if something is later found to have been broken
by it...

Fixes #351.

Reported-by: Daniel Fleischer <https://github.com/danielfleischer>
This commit is contained in:
Adam Porter 2023-09-14 08:10:49 -05:00
parent 131407814e
commit 95abce2340
3 changed files with 38 additions and 33 deletions

View file

@ -1033,6 +1033,10 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog
org-ql-find).
• Query parser ignores leading whitespace (e.g. preventing errors
while the user is typing a query into org-ql-find).
• Use of org-ql-find with :query-prefix argument prevented
selection of results. (#351
(https://github.com/alphapapa/org-ql/issues/351). Thanks to Daniel
Fleischer (https://github.com/danielfleischer) for reporting.)

File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog
@ -1774,37 +1778,37 @@ Node: Links37257
Node: Tips37944
Node: Changelog38268
Node: 072-pre39053
Node: 07139446
Node: 0740259
Node: 06343183
Node: 06243714
Node: 06144019
Node: 0644587
Node: 05247641
Node: 05147941
Node: 0548364
Node: 04949895
Node: 04850177
Node: 04750526
Node: 04650935
Node: 04551343
Node: 04451704
Node: 04352063
Node: 04252266
Node: 04152427
Node: 0452674
Node: 03256775
Node: 03157178
Node: 0357375
Node: 02360675
Node: 02260909
Node: 02161189
Node: 0261394
Node: 0165472
Node: Notes65573
Node: Comparison with Org Agenda searches65735
Node: org-sidebar66624
Node: License66903
Node: 07139697
Node: 0740510
Node: 06343434
Node: 06243965
Node: 06144270
Node: 0644838
Node: 05247892
Node: 05148192
Node: 0548615
Node: 04950146
Node: 04850428
Node: 04750777
Node: 04651186
Node: 04551594
Node: 04451955
Node: 04352314
Node: 04252517
Node: 04152678
Node: 0452925
Node: 03257026
Node: 03157429
Node: 0357626
Node: 02360926
Node: 02261160
Node: 02161440
Node: 0261645
Node: 0165723
Node: Notes65824
Node: Comparison with Org Agenda searches65986
Node: org-sidebar66875
Node: License67154

End Tag Table