From 76d202cd8dc3445674eb37f6bac99be33eb5cd48 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 26 Sep 2023 13:41:07 -0500 Subject: [PATCH] Fix: (org-ql-find) Use org-with-point-at I keep pointing out to other people that they should use org-with-point-at, but I still have places in my own code where I need to use it, too! --- README.org | 1 + org-ql-find.el | 3 +-- org-ql.info | 63 +++++++++++++++++++++++++------------------------- 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index cc926a52..c2dbe85c 100644 --- a/README.org +++ b/README.org @@ -548,6 +548,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~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. ([[https://github.com/alphapapa/org-ql/issues/351][#351]]. Thanks to [[https://github.com/danielfleischer][Daniel Fleischer]] for reporting.) ++ Handle narrowed buffers correctly in ~org-ql-find~. ** 0.7.1 diff --git a/org-ql-find.el b/org-ql-find.el index dd116132..066d28f6 100644 --- a/org-ql-find.el +++ b/org-ql-find.el @@ -83,8 +83,7 @@ single predicate)." :query-prefix query-prefix :query-filter query-filter :prompt prompt))) - (with-current-buffer (marker-buffer marker) - (goto-char marker) + (org-with-point-at marker (display-buffer (current-buffer) org-ql-find-display-buffer-action) (select-window (get-buffer-window (current-buffer))) (run-hook-with-args 'org-ql-find-goto-hook)))) diff --git a/org-ql.info b/org-ql.info index f2cf8011..61ea89d0 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1037,6 +1037,7 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog selection of results. (#351 (https://github.com/alphapapa/org-ql/issues/351). Thanks to Daniel Fleischer (https://github.com/danielfleischer) for reporting.) + • Handle narrowed buffers correctly in ‘org-ql-find’.  File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog @@ -1778,37 +1779,37 @@ Node: Links37257 Node: Tips37944 Node: Changelog38268 Node: 072-pre39053 -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 +Node: 07139760 +Node: 0740573 +Node: 06343497 +Node: 06244028 +Node: 06144333 +Node: 0644901 +Node: 05247955 +Node: 05148255 +Node: 0548678 +Node: 04950209 +Node: 04850491 +Node: 04750840 +Node: 04651249 +Node: 04551657 +Node: 04452018 +Node: 04352377 +Node: 04252580 +Node: 04152741 +Node: 0452988 +Node: 03257089 +Node: 03157492 +Node: 0357689 +Node: 02360989 +Node: 02261223 +Node: 02161503 +Node: 0261708 +Node: 0165786 +Node: Notes65887 +Node: Comparison with Org Agenda searches66049 +Node: org-sidebar66938 +Node: License67217  End Tag Table