diff --git a/README.org b/README.org index 92de36f..ad803be 100644 --- a/README.org +++ b/README.org @@ -546,6 +546,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + Function ~org-ql-completing-read~ is more compatible with default Emacs completion. (See [[https://github.com/alphapapa/org-ql/issues/338][#338]]. Thanks to [[https://github.com/arozbiz][arozbiz]] for reporting.) ++ Function ~org-ql-completing-read~ would sometimes stop updating with changes in input. (See [[https://github.com/alphapapa/org-ql/issues/350][#350]]. Thanks to [[https://github.com/anpandey][Ankit Raj Pandey]] for reporting and fixing, and to [[https://github.com/minad][Daniel Mendler]] for advising.) + In ~org-ql-completing-read~, format links for display, and use ~org-entry-get~ internally rather than ~org-get-heading~. ** 0.7 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 7d335b3..952ebf1 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -123,7 +123,8 @@ single predicate)." (if-let ((suffix (gethash heading disambiguations))) (setf heading (format "%s <%s>" heading (cl-incf suffix))) (setf heading (format "%s <%s>" heading (puthash heading 2 disambiguations))))) - (puthash heading (point-marker) table))) + (let ((marker (point-marker))) + (puthash (propertize heading 'org-marker marker) marker table)))) (path (marker) (org-with-point-at marker (let* ((path (thread-first (org-get-outline-path nil t) @@ -140,7 +141,7 @@ single predicate)." (affix (completions) ;; (debug-message "AFFIX:%S" completions) (cl-loop for completion in completions - for marker = (gethash completion table) + for marker = (get-text-property 0 'org-marker completion) for prefix = (todo marker) for suffix = (concat (path marker) " " (snippet marker)) collect (list completion prefix suffix))) @@ -150,7 +151,7 @@ single predicate)." ;; Using `while-no-input' here doesn't make it as responsive as, ;; e.g. Helm while typing, but it seems to help a little when using the ;; org-rifle-style snippets. - (or (snippet (gethash candidate table)) ""))) + (or (snippet (get-text-property 0 'org-marker completion)) ""))) (snippet (marker) (when-let ((snippet @@ -161,7 +162,7 @@ single predicate)." 'face 'org-ql-completing-read-snippet))) (group (candidate transform) (pcase transform - (`nil (buffer-name (marker-buffer (gethash candidate table)))) + (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) (_ candidate))) (try (string _collection _pred point &optional _metadata) ;; (debug-message "TRY: STRING:%S" string) diff --git a/org-ql.info b/org-ql.info index bc9c3be..5ecb26e 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1030,6 +1030,11 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog Emacs completion. (See #338 (https://github.com/alphapapa/org-ql/issues/338). Thanks to arozbiz (https://github.com/arozbiz) for reporting.) + • Function ‘org-ql-completing-read’ would sometimes stop updating + with changes in input. (See #350 + (https://github.com/alphapapa/org-ql/issues/350). Thanks to Ankit + Raj Pandey (https://github.com/anpandey) for reporting and fixing, + and to Daniel Mendler (https://github.com/minad) for advising.) • In ‘org-ql-completing-read’, format links for display, and use ‘org-entry-get’ internally rather than ‘org-get-heading’. @@ -1754,36 +1759,36 @@ Node: Links37243 Node: Tips37930 Node: Changelog38254 Node: 071-pre39025 -Node: 0739507 -Node: 06342435 -Node: 06242966 -Node: 06143271 -Node: 0643839 -Node: 05246893 -Node: 05147193 -Node: 0547616 -Node: 04949145 -Node: 04849427 -Node: 04749776 -Node: 04650185 -Node: 04550593 -Node: 04450954 -Node: 04351313 -Node: 04251516 -Node: 04151677 -Node: 0451924 -Node: 03256025 -Node: 03156428 -Node: 0356625 -Node: 02359925 -Node: 02260159 -Node: 02160439 -Node: 0260644 -Node: 0164722 -Node: Notes64823 -Node: Comparison with Org Agenda searches64985 -Node: org-sidebar65874 -Node: License66153 +Node: 0739834 +Node: 06342762 +Node: 06243293 +Node: 06143598 +Node: 0644166 +Node: 05247220 +Node: 05147520 +Node: 0547943 +Node: 04949472 +Node: 04849754 +Node: 04750103 +Node: 04650512 +Node: 04550920 +Node: 04451281 +Node: 04351640 +Node: 04251843 +Node: 04152004 +Node: 0452251 +Node: 03256352 +Node: 03156755 +Node: 0356952 +Node: 02360252 +Node: 02260486 +Node: 02160766 +Node: 0260971 +Node: 0165049 +Node: Notes65150 +Node: Comparison with Org Agenda searches65312 +Node: org-sidebar66201 +Node: License66480  End Tag Table