From 2c098540cab6a0ee7d82abe2327d524a171edd1e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 5 May 2023 17:23:50 -0500 Subject: [PATCH 01/16] Fix: (org-ql-completing-read) Format links before display Also use org-entry-get to get the heading, which should avoid issues with different Org versions having different optional arguments to org-get-heading. --- README.org | 1 + org-ql-completing-read.el | 2 +- org-ql.info | 242 +++++++++++++++++++------------------- 3 files changed, 124 insertions(+), 121 deletions(-) diff --git a/README.org b/README.org index 5135cdc..827f04f 100644 --- a/README.org +++ b/README.org @@ -547,6 +547,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.) ++ 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 b72c8fa..7d335b3 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -116,7 +116,7 @@ single predicate)." ;; without properties, so we have to use `org-get-heading', which added additional ;; optional arguments in a certain Org version, so in those versions, it will ;; return priority cookies and comment strings. - (let ((heading (org-get-heading t t))) + (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) (when (gethash heading table) ;; Disambiguate heading (even adding the path isn't enough, because that could ;; also be duplicated). diff --git a/org-ql.info b/org-ql.info index 7998193..bc9c3be 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1,4 +1,4 @@ -This is README.info, produced by makeinfo version 5.2 from README.texi. +This is README.info, produced by makeinfo version 6.7 from README.texi. INFO-DIR-SECTION Emacs START-INFO-DIR-ENTRY @@ -71,33 +71,33 @@ Functions / Macros Changelog -* 0.7.1-pre: 071-pre. -* 0.7: 07. -* 0.6.3: 063. -* 0.6.2: 062. -* 0.6.1: 061. -* 0.6: 06. -* 0.5.2: 052. -* 0.5.1: 051. -* 0.5: 05. -* 0.4.9: 049. -* 0.4.8: 048. -* 0.4.7: 047. -* 0.4.6: 046. -* 0.4.5: 045. -* 0.4.4: 044. -* 0.4.3: 043. -* 0.4.2: 042. -* 0.4.1: 041. -* 0.4: 04. -* 0.3.2: 032. -* 0.3.1: 031. -* 0.3: 03. -* 0.2.3: 023. -* 0.2.2: 022. -* 0.2.1: 021. -* 0.2: 02. -* 0.1: 01. +* 0.7.1-pre: 071-pre. +* 0.7: 07. +* 0.6.3: 063. +* 0.6.2: 062. +* 0.6.1: 061. +* 0.6: 06. +* 0.5.2: 052. +* 0.5.1: 051. +* 0.5: 05. +* 0.4.9: 049. +* 0.4.8: 048. +* 0.4.7: 047. +* 0.4.6: 046. +* 0.4.5: 045. +* 0.4.4: 044. +* 0.4.3: 043. +* 0.4.2: 042. +* 0.4.1: 041. +* 0.4: 04. +* 0.3.2: 032. +* 0.3.1: 031. +* 0.3: 03. +* 0.2.3: 023. +* 0.2.2: 022. +* 0.2.1: 021. +* 0.2: 02. +* 0.1: 01. Notes @@ -991,33 +991,33 @@ releases. * Menu: -* 0.7.1-pre: 071-pre. -* 0.7: 07. -* 0.6.3: 063. -* 0.6.2: 062. -* 0.6.1: 061. -* 0.6: 06. -* 0.5.2: 052. -* 0.5.1: 051. -* 0.5: 05. -* 0.4.9: 049. -* 0.4.8: 048. -* 0.4.7: 047. -* 0.4.6: 046. -* 0.4.5: 045. -* 0.4.4: 044. -* 0.4.3: 043. -* 0.4.2: 042. -* 0.4.1: 041. -* 0.4: 04. -* 0.3.2: 032. -* 0.3.1: 031. -* 0.3: 03. -* 0.2.3: 023. -* 0.2.2: 022. -* 0.2.1: 021. -* 0.2: 02. -* 0.1: 01. +* 0.7.1-pre: 071-pre. +* 0.7: 07. +* 0.6.3: 063. +* 0.6.2: 062. +* 0.6.1: 061. +* 0.6: 06. +* 0.5.2: 052. +* 0.5.1: 051. +* 0.5: 05. +* 0.4.9: 049. +* 0.4.8: 048. +* 0.4.7: 047. +* 0.4.6: 046. +* 0.4.5: 045. +* 0.4.4: 044. +* 0.4.3: 043. +* 0.4.2: 042. +* 0.4.1: 041. +* 0.4: 04. +* 0.3.2: 032. +* 0.3.1: 031. +* 0.3: 03. +* 0.2.3: 023. +* 0.2.2: 022. +* 0.2.1: 021. +* 0.2: 02. +* 0.1: 01.  File: README.info, Node: 071-pre, Next: 07, Up: Changelog @@ -1030,6 +1030,8 @@ 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.) + • In ‘org-ql-completing-read’, format links for display, and use + ‘org-entry-get’ internally rather than ‘org-get-heading’.  File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog @@ -1717,71 +1719,71 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1812 -Node: Screenshots1935 -Node: Installation2053 -Node: Quelpa2567 -Node: Helm support3095 -Node: Usage3498 -Node: Commands3896 -Node: org-ql-find4340 -Node: org-ql-refile4806 -Node: org-ql-search5129 -Node: helm-org-ql6825 -Node: org-ql-view7203 -Node: org-ql-view-sidebar7733 -Node: org-ql-view-recent-items8113 -Node: org-ql-sparse-tree8609 -Node: Queries9409 -Node: Non-sexp query syntax10526 -Node: General predicates12285 -Node: Ancestor/descendant predicates19272 -Node: Date/time predicates20400 -Node: Functions / Macros23524 -Node: Agenda-like views23822 -Ref: Function ‘org-ql-block’23984 -Node: Listing / acting-on results25245 -Ref: Caching25453 -Ref: Function ‘org-ql-select’26366 -Ref: Function ‘org-ql-query’28792 -Ref: Macro ‘org-ql’ (deprecated)30566 -Node: Custom predicates30881 -Ref: Macro ‘org-ql-defpred’31105 -Node: Dynamic block34546 -Node: Links37270 -Node: Tips37957 -Node: Changelog38281 -Node: 071-pre39079 -Node: 0739416 -Node: 06342344 -Node: 06242875 -Node: 06143180 -Node: 0643748 -Node: 05246802 -Node: 05147102 -Node: 0547525 -Node: 04949054 -Node: 04849336 -Node: 04749685 -Node: 04650094 -Node: 04550502 -Node: 04450863 -Node: 04351222 -Node: 04251425 -Node: 04151586 -Node: 0451833 -Node: 03255934 -Node: 03156337 -Node: 0356534 -Node: 02359834 -Node: 02260068 -Node: 02160348 -Node: 0260553 -Node: 0164631 -Node: Notes64732 -Node: Comparison with Org Agenda searches64894 -Node: org-sidebar65783 -Node: License66062 +Node: Contents1785 +Node: Screenshots1908 +Node: Installation2026 +Node: Quelpa2540 +Node: Helm support3068 +Node: Usage3471 +Node: Commands3869 +Node: org-ql-find4313 +Node: org-ql-refile4779 +Node: org-ql-search5102 +Node: helm-org-ql6798 +Node: org-ql-view7176 +Node: org-ql-view-sidebar7706 +Node: org-ql-view-recent-items8086 +Node: org-ql-sparse-tree8582 +Node: Queries9382 +Node: Non-sexp query syntax10499 +Node: General predicates12258 +Node: Ancestor/descendant predicates19245 +Node: Date/time predicates20373 +Node: Functions / Macros23497 +Node: Agenda-like views23795 +Ref: Function org-ql-block23957 +Node: Listing / acting-on results25218 +Ref: Caching25426 +Ref: Function org-ql-select26339 +Ref: Function org-ql-query28765 +Ref: Macro org-ql (deprecated)30539 +Node: Custom predicates30854 +Ref: Macro org-ql-defpred31078 +Node: Dynamic block34519 +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  End Tag Table From eb5377320fcfd38354d6e9e3e655969ae3c0e052 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 25 May 2023 10:48:47 -0500 Subject: [PATCH 02/16] Comment: Add FIXME --- org-ql.el | 1 + 1 file changed, 1 insertion(+) diff --git a/org-ql.el b/org-ql.el index c0f548a..94f48c7 100644 --- a/org-ql.el +++ b/org-ql.el @@ -76,6 +76,7 @@ Tags are stored in match group 1. Match group 2 stores the tags without the enclosing colons.") (defvaralias 'org-ql-link-regexp + ;; FIXME: `org-link-bracket-re' is void until `org-link-make-regexps' is called. (if (bound-and-true-p org-link-bracket-re) 'org-link-bracket-re 'org-bracket-link-regexp) From 898addeee956b02118f1db421a1a6c21cd5bd866 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Mon, 4 Sep 2023 22:40:52 -0500 Subject: [PATCH 03/16] Docs: Tidy The circumstances which precipitated this expression of support for fellow developers thankfully passed some time ago. --- README.org | 1 - images/dont-tread-on-emacs-150.png | Bin 5660 -> 0 bytes 2 files changed, 1 deletion(-) delete mode 100644 images/dont-tread-on-emacs-150.png diff --git a/README.org b/README.org index 827f04f..92de36f 100644 --- a/README.org +++ b/README.org @@ -1,7 +1,6 @@ #+TITLE: org-ql # NOTE: Using =BEGIN_HTML= for this causes TeX/info export to fail, but this HTML block works. -# #+HTML: #+HTML: # NOTE: To avoid having this in the info manual, we use HTML rather than Org syntax; it still appears with the GitHub renderer. diff --git a/images/dont-tread-on-emacs-150.png b/images/dont-tread-on-emacs-150.png deleted file mode 100644 index 71f37362a5289714efa07aed1e7520198e8f8b87..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5660 zcmeAS@N?(olHy`uVBq!ia0y~yV3@|hz>vbh1|p+Reqdl=U@3O;4B_D5;Hcq9>0n@B z;4JWnEM{O()C6J1dq)rZF)%PlmbgZg1m~xflqVLYGL)B>>t*I;7bhncr0V4trO$q6 zBgMcVI@8m|F{EP7+qsoFGS_R5+ZVs})yvn*|2UyEU{lKLZL;2dk1ag-Z)VO}mLa5) zadDYz@D`7WOsq^>G6F<0nzy({ZQ;1Z;#qvPY?g)ZWs5=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_)DkN?saFZn*cDgXSs_w2I5 zt!rj(@baEJr>08$`MDm358d;>f8OZ-X7L^y`#Fy{9=|R2#DSr9Z=#fxci@y>Ltibi z;GH#@P0sD&Tq$PhYw}O@-?1s$(kcFbefzw30=9P*_2$Sg-nTHt(IQgJvSbJ2#rAVSKo8sefE03!Z!<_nsTH`%5)eR$?Sgow|rUQ z);m{k@v`%o282CJDo^J%HH|wrPckvbZGo=+}>#XP7}VKc73PAE@5d&kg5#QF5AH#Y)Z zv!gBd+9vv3e)J=GZN*+b70vn4=BB@I-i>rV{>{tH?a>@->s@Q!SN*-EvfDbl;)8>2 z-u6T1>#wzEMqRl&{lb+u&-clO-g(0%*#ETn^uvWO79IVf^Y*PM%d1a`)zybMnEw0< zwhk2OtcZDh(S7^Fl9Qh=S;+Yq*p#F*?vsw*CVXqzh8xq$2@Gd$!yNSd&tH7{&4nKY T9~Ln%Ffe$!`njxgN@xNAk>vYn From a7af6d78b220f374221d802397fb2337238a3b89 Mon Sep 17 00:00:00 2001 From: Ankit Pandey Date: Wed, 21 Jun 2023 04:02:59 -0700 Subject: [PATCH 04/16] Fix: (org-ql-completing-read) Store markers as text property Fixes #350 --- org-ql-completing-read.el | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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) From 2d29d69133ae7d437afb4ce0a1f644b0bfd42d75 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 16:08:54 -0500 Subject: [PATCH 05/16] Docs: Update changelog --- README.org | 1 + org-ql.info | 65 ++++++++++++++++++++++++++++------------------------- 2 files changed, 36 insertions(+), 30 deletions(-) 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.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 From 3c24958738089990692267265943c7fad29e59f3 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:55:39 -0500 Subject: [PATCH 06/16] Fix: (org-ql-completing-read) Variable name --- org-ql-completing-read.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 952ebf1..47b6c35 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -151,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 (get-text-property 0 'org-marker completion)) ""))) + (or (snippet (get-text-property 0 'org-marker candidate)) ""))) (snippet (marker) (when-let ((snippet From ed81b7d7c81479a73f50a46c2f0e338ec264b924 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:56:32 -0500 Subject: [PATCH 07/16] Tests: Require xr This is only a development dependency. --- tests/test-org-ql.el | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 5f9463f..9008179 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -33,6 +33,8 @@ (require 'org-ql-search) (require 'org-ql-view) +(require 'xr) + ;;;; Variables (defvar org-ql-test-buffer nil From d776e205d53adccd1d66a9c666fd885a2334262e Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 18:57:36 -0500 Subject: [PATCH 08/16] Release: v0.7.1 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 142 ++++++++++++++++++++++++++-------------------------- 3 files changed, 73 insertions(+), 73 deletions(-) diff --git a/README.org b/README.org index ad803be..13d6732 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. -** 0.7.1-pre +** 0.7.1 *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.) diff --git a/org-ql.el b/org-ql.el index 94f48c7..991944e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.7.1-pre +;; Version: 0.7.1 ;; Package-Requires: ((emacs "26.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 5ecb26e..900e0ce 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.1-pre: 071-pre. +* 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -991,7 +991,7 @@ releases. * Menu: -* 0.7.1-pre: 071-pre. +* 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. * 0.6.2: 062. @@ -1020,10 +1020,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 071-pre, Next: 07, Up: Changelog +File: README.info, Node: 071, Next: 07, Up: Changelog -5.1 0.7.1-pre -============= +5.1 0.7.1 +========= *Fixes* • Function ‘org-ql-completing-read’ is more compatible with default @@ -1039,7 +1039,7 @@ File: README.info, Node: 071-pre, Next: 07, Up: Changelog ‘org-entry-get’ internally rather than ‘org-get-heading’.  -File: README.info, Node: 07, Next: 063, Prev: 071-pre, Up: Changelog +File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog 5.2 0.7 ======= @@ -1724,71 +1724,71 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1785 -Node: Screenshots1908 -Node: Installation2026 -Node: Quelpa2540 -Node: Helm support3068 -Node: Usage3471 -Node: Commands3869 -Node: org-ql-find4313 -Node: org-ql-refile4779 -Node: org-ql-search5102 -Node: helm-org-ql6798 -Node: org-ql-view7176 -Node: org-ql-view-sidebar7706 -Node: org-ql-view-recent-items8086 -Node: org-ql-sparse-tree8582 -Node: Queries9382 -Node: Non-sexp query syntax10499 -Node: General predicates12258 -Node: Ancestor/descendant predicates19245 -Node: Date/time predicates20373 -Node: Functions / Macros23497 -Node: Agenda-like views23795 -Ref: Function org-ql-block23957 -Node: Listing / acting-on results25218 -Ref: Caching25426 -Ref: Function org-ql-select26339 -Ref: Function org-ql-query28765 -Ref: Macro org-ql (deprecated)30539 -Node: Custom predicates30854 -Ref: Macro org-ql-defpred31078 -Node: Dynamic block34519 -Node: Links37243 -Node: Tips37930 -Node: Changelog38254 -Node: 071-pre39025 -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 +Node: Contents1777 +Node: Screenshots1900 +Node: Installation2018 +Node: Quelpa2532 +Node: Helm support3060 +Node: Usage3463 +Node: Commands3861 +Node: org-ql-find4305 +Node: org-ql-refile4771 +Node: org-ql-search5094 +Node: helm-org-ql6790 +Node: org-ql-view7168 +Node: org-ql-view-sidebar7698 +Node: org-ql-view-recent-items8078 +Node: org-ql-sparse-tree8574 +Node: Queries9374 +Node: Non-sexp query syntax10491 +Node: General predicates12250 +Node: Ancestor/descendant predicates19237 +Node: Date/time predicates20365 +Node: Functions / Macros23489 +Node: Agenda-like views23787 +Ref: Function org-ql-block23949 +Node: Listing / acting-on results25210 +Ref: Caching25418 +Ref: Function org-ql-select26331 +Ref: Function org-ql-query28757 +Ref: Macro org-ql (deprecated)30531 +Node: Custom predicates30846 +Ref: Macro org-ql-defpred31070 +Node: Dynamic block34511 +Node: Links37235 +Node: Tips37922 +Node: Changelog38246 +Node: 07139009 +Node: 0739806 +Node: 06342730 +Node: 06243261 +Node: 06143566 +Node: 0644134 +Node: 05247188 +Node: 05147488 +Node: 0547911 +Node: 04949440 +Node: 04849722 +Node: 04750071 +Node: 04650480 +Node: 04550888 +Node: 04451249 +Node: 04351608 +Node: 04251811 +Node: 04151972 +Node: 0452219 +Node: 03256320 +Node: 03156723 +Node: 0356920 +Node: 02360220 +Node: 02260454 +Node: 02160734 +Node: 0260939 +Node: 0165017 +Node: Notes65118 +Node: Comparison with Org Agenda searches65280 +Node: org-sidebar66169 +Node: License66448  End Tag Table From 3622b92403a53c360ea9ed9ca8692a157cec8a4c Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 20:49:12 -0500 Subject: [PATCH 09/16] Meta: v0.7.2-pre --- README.org | 4 ++++ org-ql.el | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 13d6732..32d6662 100644 --- a/README.org +++ b/README.org @@ -542,6 +542,10 @@ Simple links may also be written manually in either sexp or non-sexp form, like: /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. +** 0.7.2-pre + +Nothing new yet. + ** 0.7.1 *Fixes* diff --git a/org-ql.el b/org-ql.el index 991944e..b92784e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.7.1 +;; Version: 0.7.2-pre ;; Package-Requires: ((emacs "26.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda From f65b1d91a49468e176bd733d3b930ec4b7ed4cf1 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 6 Sep 2023 20:50:39 -0500 Subject: [PATCH 10/16] Fix: (org-ql--normalize-from-to-on) Tolerate "-" input Avoids errors while typing a query (e.g. a negative number) into org-ql-find, which interrupts completion altogether. --- README.org | 3 ++- org-ql.el | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 32d6662..92d5cb5 100644 --- a/README.org +++ b/README.org @@ -544,7 +544,8 @@ Simple links may also be written manually in either sexp or non-sexp form, like: ** 0.7.2-pre -Nothing new yet. +*Fixes* ++ Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). ** 0.7.1 diff --git a/org-ql.el b/org-ql.el index b92784e..e153138 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1286,6 +1286,9 @@ result form." to on)) (when from (setq from (pcase from + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 0 :minute 0 :second 0))) ((pred numberp) (->> (ts-now) @@ -1302,6 +1305,9 @@ result form." ((pred ts-p) from)))) (when to (setq to (pcase to + ("-" + ;; Ignore, because it means the user is typing a negative number. + nil) ((or 'today "today") (->> (ts-now) (ts-apply :hour 23 :minute 59 :second 59))) ((pred numberp) (->> (ts-now) From 131407814ebfd8d409f23bc5cceeeb2b5da1a8d9 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 8 Sep 2023 02:22:40 -0500 Subject: [PATCH 11/16] Fix: (org-ql--def-query-string-to-sexp-fn) Ignore leading blanks --- README.org | 1 + org-ql.el | 2 +- org-ql.info | 204 ++++++++++++++++++++++++++++------------------------ 3 files changed, 112 insertions(+), 95 deletions(-) diff --git a/README.org b/README.org index 92d5cb5..4e499a6 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* + 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~). ** 0.7.1 diff --git a/org-ql.el b/org-ql.el index e153138..2a54768 100644 --- a/org-ql.el +++ b/org-ql.el @@ -945,7 +945,7 @@ value of `org-ql-predicates')." ;; obscure bug in `peg': when one keyword is a substring of another, ;; and the shorter one is listed first, the shorter one fails to match. (-sort (-on #'> #'length)))) - (pexs `((query (+ (and term (* [blank])))) + (pexs `((query (and (* [blank]) (+ (and term (* [blank]))))) (term (or (and negation (list positive-term) ;; This is a bit confusing, but it seems to work. There's probably a better way. `(pred -- (list 'not (car pred)))) diff --git a/org-ql.info b/org-ql.info index 900e0ce..c120823 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,6 +71,7 @@ Functions / Macros Changelog +* 0.7.2-pre: 072-pre. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -991,6 +992,7 @@ releases. * Menu: +* 0.7.2-pre: 072-pre. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -1020,9 +1022,22 @@ releases. * 0.1: 01.  -File: README.info, Node: 071, Next: 07, Up: Changelog +File: README.info, Node: 072-pre, Next: 071, Up: Changelog -5.1 0.7.1 +5.1 0.7.2-pre +============= + +*Fixes* + • 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’). + + +File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog + +5.2 0.7.1 ========= *Fixes* @@ -1041,7 +1056,7 @@ File: README.info, Node: 071, Next: 07, Up: Changelog  File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog -5.2 0.7 +5.3 0.7 ======= *Added* @@ -1101,7 +1116,7 @@ File: README.info, Node: 07, Next: 063, Prev: 071, Up: Changelog  File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog -5.3 0.6.3 +5.4 0.6.3 ========= *Fixed* @@ -1117,7 +1132,7 @@ File: README.info, Node: 063, Next: 062, Prev: 07, Up: Changelog  File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog -5.4 0.6.2 +5.5 0.6.2 ========= *Fixed* @@ -1128,7 +1143,7 @@ File: README.info, Node: 062, Next: 061, Prev: 063, Up: Changelog  File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog -5.5 0.6.1 +5.6 0.6.1 ========= *Fixed* @@ -1146,7 +1161,7 @@ File: README.info, Node: 061, Next: 06, Prev: 062, Up: Changelog  File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog -5.6 0.6 +5.7 0.6 ======= *Added* @@ -1213,7 +1228,7 @@ File: README.info, Node: 06, Next: 052, Prev: 061, Up: Changelog  File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog -5.7 0.5.2 +5.8 0.5.2 ========= *Fixed* @@ -1224,7 +1239,7 @@ File: README.info, Node: 052, Next: 051, Prev: 06, Up: Changelog  File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog -5.8 0.5.1 +5.9 0.5.1 ========= *Fixed* @@ -1237,8 +1252,8 @@ File: README.info, Node: 051, Next: 05, Prev: 052, Up: Changelog  File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog -5.9 0.5 -======= +5.10 0.5 +======== *Added* • View dispatcher using ‘transient.el’ (like Magit), bound to ‘v’ in @@ -1278,7 +1293,7 @@ File: README.info, Node: 05, Next: 049, Prev: 051, Up: Changelog  File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog -5.10 0.4.9 +5.11 0.4.9 ========== *Fixed* @@ -1289,7 +1304,7 @@ File: README.info, Node: 049, Next: 048, Prev: 05, Up: Changelog  File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog -5.11 0.4.8 +5.12 0.4.8 ========== *Fixed* @@ -1301,7 +1316,7 @@ File: README.info, Node: 048, Next: 047, Prev: 049, Up: Changelog  File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog -5.12 0.4.7 +5.13 0.4.7 ========== *Fixed* @@ -1314,7 +1329,7 @@ File: README.info, Node: 047, Next: 046, Prev: 048, Up: Changelog  File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog -5.13 0.4.6 +5.14 0.4.6 ========== *Fixed* @@ -1327,7 +1342,7 @@ File: README.info, Node: 046, Next: 045, Prev: 047, Up: Changelog  File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog -5.14 0.4.5 +5.15 0.4.5 ========== *Fixed* @@ -1339,7 +1354,7 @@ File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog  File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog -5.15 0.4.4 +5.16 0.4.4 ========== *Fixed* @@ -1351,7 +1366,7 @@ File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.16 0.4.3 +5.17 0.4.3 ========== *Fixed* @@ -1361,7 +1376,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.17 0.4.2 +5.18 0.4.2 ========== *Fixed* @@ -1370,7 +1385,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.18 0.4.1 +5.19 0.4.1 ========== *Fixed* @@ -1380,7 +1395,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.19 0.4 +5.20 0.4 ======== _Note:_ The next release, 0.5, may include changes which will require @@ -1461,7 +1476,7 @@ automatically, as they will be pushed to the ‘master’ branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.20 0.3.2 +5.21 0.3.2 ========== *Fixed* @@ -1474,7 +1489,7 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.21 0.3.1 +5.22 0.3.1 ========== *Fixed* @@ -1484,7 +1499,7 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.22 0.3 +5.23 0.3 ======== *Added* @@ -1552,7 +1567,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.23 0.2.3 +5.24 0.2.3 ========== *Fixed* @@ -1562,7 +1577,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.24 0.2.2 +5.25 0.2.2 ========== *Fixed* @@ -1573,7 +1588,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.25 0.2.1 +5.26 0.2.1 ========== *Fixed* @@ -1583,7 +1598,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.26 0.2 +5.27 0.2 ======== *Added* @@ -1666,7 +1681,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.27 0.1 +5.28 0.1 ======== First tagged release. @@ -1724,71 +1739,72 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1777 -Node: Screenshots1900 -Node: Installation2018 -Node: Quelpa2532 -Node: Helm support3060 -Node: Usage3463 -Node: Commands3861 -Node: org-ql-find4305 -Node: org-ql-refile4771 -Node: org-ql-search5094 -Node: helm-org-ql6790 -Node: org-ql-view7168 -Node: org-ql-view-sidebar7698 -Node: org-ql-view-recent-items8078 -Node: org-ql-sparse-tree8574 -Node: Queries9374 -Node: Non-sexp query syntax10491 -Node: General predicates12250 -Node: Ancestor/descendant predicates19237 -Node: Date/time predicates20365 -Node: Functions / Macros23489 -Node: Agenda-like views23787 -Ref: Function org-ql-block23949 -Node: Listing / acting-on results25210 -Ref: Caching25418 -Ref: Function org-ql-select26331 -Ref: Function org-ql-query28757 -Ref: Macro org-ql (deprecated)30531 -Node: Custom predicates30846 -Ref: Macro org-ql-defpred31070 -Node: Dynamic block34511 -Node: Links37235 -Node: Tips37922 -Node: Changelog38246 -Node: 07139009 -Node: 0739806 -Node: 06342730 -Node: 06243261 -Node: 06143566 -Node: 0644134 -Node: 05247188 -Node: 05147488 -Node: 0547911 -Node: 04949440 -Node: 04849722 -Node: 04750071 -Node: 04650480 -Node: 04550888 -Node: 04451249 -Node: 04351608 -Node: 04251811 -Node: 04151972 -Node: 0452219 -Node: 03256320 -Node: 03156723 -Node: 0356920 -Node: 02360220 -Node: 02260454 -Node: 02160734 -Node: 0260939 -Node: 0165017 -Node: Notes65118 -Node: Comparison with Org Agenda searches65280 -Node: org-sidebar66169 -Node: License66448 +Node: Contents1799 +Node: Screenshots1922 +Node: Installation2040 +Node: Quelpa2554 +Node: Helm support3082 +Node: Usage3485 +Node: Commands3883 +Node: org-ql-find4327 +Node: org-ql-refile4793 +Node: org-ql-search5116 +Node: helm-org-ql6812 +Node: org-ql-view7190 +Node: org-ql-view-sidebar7720 +Node: org-ql-view-recent-items8100 +Node: org-ql-sparse-tree8596 +Node: Queries9396 +Node: Non-sexp query syntax10513 +Node: General predicates12272 +Node: Ancestor/descendant predicates19259 +Node: Date/time predicates20387 +Node: Functions / Macros23511 +Node: Agenda-like views23809 +Ref: Function org-ql-block23971 +Node: Listing / acting-on results25232 +Ref: Caching25440 +Ref: Function org-ql-select26353 +Ref: Function org-ql-query28779 +Ref: Macro org-ql (deprecated)30553 +Node: Custom predicates30868 +Ref: Macro org-ql-defpred31092 +Node: Dynamic block34533 +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  End Tag Table From 95abce2340efabecc6f07626eb3f28159929709f Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Thu, 14 Sep 2023 08:10:49 -0500 Subject: [PATCH 12/16] 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 --- README.org | 1 + org-ql-completing-read.el | 4 +-- org-ql.info | 66 +++++++++++++++++++++------------------ 3 files changed, 38 insertions(+), 33 deletions(-) diff --git a/README.org b/README.org index 4e499a6..cc926a5 100644 --- a/README.org +++ b/README.org @@ -547,6 +547,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: *Fixes* + 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.) ** 0.7.1 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 47b6c35..aa6b887 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -172,8 +172,6 @@ single predicate)." ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) (all-completions string table pred)) (collection (input _pred flag) - (when query-prefix - (setf input (concat query-prefix input))) (pcase flag ('metadata (list 'metadata (cons 'group-function #'group) @@ -224,6 +222,8 @@ single predicate)." `(boundaries 0 . ,(length suffix))))) (run-query (input) ;; (debug-message "RUN-QUERY:%S" input) + (when query-prefix + (setf input (concat query-prefix input))) (unless (or (string-empty-p input) (equal last-input input)) ;; (debug-message "RUN-QUERY:%S RUNNING" input) diff --git a/org-ql.info b/org-ql.info index c120823..f2cf801 100644 --- a/org-ql.info +++ b/org-ql.info @@ -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 From 8412d1a23d135cf80f850e6a49f9bbbebcb60100 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Fri, 22 Sep 2023 22:08:57 -0500 Subject: [PATCH 13/16] Tidy: Indentation For Emacs 29.1. --- org-ql-completing-read.el | 258 +++++++++++++++++++------------------- 1 file changed, 129 insertions(+), 129 deletions(-) diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index aa6b887..1c7aa71 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -111,145 +111,145 @@ single predicate)." (cl-labels (;; (debug-message ;; (f &rest args) (apply #'message (concat "ORG-QL-COMPLETING-READ: " f) args)) (action - () (font-lock-ensure (point-at-bol) (point-at-eol)) - ;; FIXME: We want the fontified heading, and `org-heading-components' returns it - ;; without properties, so we have to use `org-get-heading', which added additional - ;; optional arguments in a certain Org version, so in those versions, it will - ;; return priority cookies and comment strings. - (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) - (when (gethash heading table) - ;; Disambiguate heading (even adding the path isn't enough, because that could - ;; also be duplicated). - (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))))) - (let ((marker (point-marker))) - (puthash (propertize heading 'org-marker marker) marker table)))) + () (font-lock-ensure (point-at-bol) (point-at-eol)) + ;; FIXME: We want the fontified heading, and `org-heading-components' returns it + ;; without properties, so we have to use `org-get-heading', which added additional + ;; optional arguments in a certain Org version, so in those versions, it will + ;; return priority cookies and comment strings. + (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) + (when (gethash heading table) + ;; Disambiguate heading (even adding the path isn't enough, because that could + ;; also be duplicated). + (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))))) + (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) - (org-format-outline-path window-width nil "") - (org-split-string ""))) - (formatted-path (if org-ql-completing-read-reverse-paths - (concat "\\" (string-join (reverse path) "\\")) - (concat "/" (string-join path "/"))))) - formatted-path))) + (org-with-point-at marker + (let* ((path (thread-first (org-get-outline-path nil t) + (org-format-outline-path window-width nil "") + (org-split-string ""))) + (formatted-path (if org-ql-completing-read-reverse-paths + (concat "\\" (string-join (reverse path) "\\")) + (concat "/" (string-join path "/"))))) + formatted-path))) (todo - (marker) (if-let (it (org-entry-get marker "TODO")) - (concat (propertize it 'face (org-get-todo-face it)) " ") - "")) + (marker) (if-let (it (org-entry-get marker "TODO")) + (concat (propertize it 'face (org-get-todo-face it)) " ") + "")) (affix (completions) - ;; (debug-message "AFFIX:%S" completions) - (cl-loop for completion in completions - 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))) + ;; (debug-message "AFFIX:%S" completions) + (cl-loop for completion in completions + 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))) (annotate (candidate) - ;; (debug-message "ANNOTATE:%S" candidate) - (while-no-input - ;; 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 (get-text-property 0 'org-marker candidate)) ""))) + ;; (debug-message "ANNOTATE:%S" candidate) + (while-no-input + ;; 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 (get-text-property 0 'org-marker candidate)) ""))) (snippet - (marker) (when-let - ((snippet - (org-with-point-at marker - (or (funcall org-ql-completing-read-snippet-function snippet-regexp) - (org-ql-completing-read--snippet-simple))))) - (propertize (concat " " snippet) - 'face 'org-ql-completing-read-snippet))) + (marker) (when-let + ((snippet + (org-with-point-at marker + (or (funcall org-ql-completing-read-snippet-function snippet-regexp) + (org-ql-completing-read--snippet-simple))))) + (propertize (concat " " snippet) + 'face 'org-ql-completing-read-snippet))) (group (candidate transform) - (pcase transform - (`nil (buffer-name (marker-buffer (get-text-property 0 'org-marker candidate)))) - (_ candidate))) + (pcase transform + (`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) - (cons string point)) + ;; (debug-message "TRY: STRING:%S" string) + (cons string point)) (all (string table pred _point) - ;; (debug-message "all: STRING:%S" string) - ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) - (all-completions string table pred)) + ;; (debug-message "all: STRING:%S" string) + ;; (debug-message "all-completions RETURNS: %S" (all-completions string table pred)) + (all-completions string table pred)) (collection (input _pred flag) - (pcase flag - ('metadata (list 'metadata - (cons 'group-function #'group) - (cons 'affixation-function #'affix) - (cons 'annotation-function #'annotate))) - (`t - ;; (debug-message "COLLECTION:t INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - ;; It's not ideal to call `run-query' unconditionally here, but due to - ;; the complexity of the "Programmed Completion" API, it's basically - ;; necessary, and org-ql's caching should make it nearly free. - (run-query input) - (hash-table-keys table)) - ('lambda - ;; (debug-message "COLLECTION:lambda INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - (if (not (hash-table-empty-p table)) - (when (gethash input table) - t) - (run-query input) - (when (gethash input table) - ;; (debug-message "COLLECTION:lambda INPUT:%S FOUND" input) - t))) - (`nil - ;; (debug-message "COLLECTION:nil INPUT:%S" input) - (if (not (hash-table-empty-p table)) - (when (gethash input table) - t) - (run-query input) - ;; (debug-message "COLLECTION:nil INPUT:%S KEYS:%S" - ;; input (hash-table-keys table)) - (cond ((hash-table-empty-p table) - nil) - ((gethash input table) - t) - (t - ;; FIXME: "it should return the longest common prefix - ;; substring of all matches otherwise"...but there's no - ;; function to compute that? At least returning an empty - ;; string doesn't seem to break anything. - input)))) - (`(boundaries . ,suffix) - ;; (debug-message "COLLECTION:boundaries INPUT:%S SUFFIX:%S KEYS:%S" - ;; input suffix (hash-table-keys table)) - ;; FIXME: This is unlikely to be correct, but I'm not even sure if it - ;; can be correct in this case since the input (e.g. "todo: foo") - ;; usually won't match a completion candidate directly. - `(boundaries 0 . ,(length suffix))))) + (pcase flag + ('metadata (list 'metadata + (cons 'group-function #'group) + (cons 'affixation-function #'affix) + (cons 'annotation-function #'annotate))) + (`t + ;; (debug-message "COLLECTION:t INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + ;; It's not ideal to call `run-query' unconditionally here, but due to + ;; the complexity of the "Programmed Completion" API, it's basically + ;; necessary, and org-ql's caching should make it nearly free. + (run-query input) + (hash-table-keys table)) + ('lambda + ;; (debug-message "COLLECTION:lambda INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + (if (not (hash-table-empty-p table)) + (when (gethash input table) + t) + (run-query input) + (when (gethash input table) + ;; (debug-message "COLLECTION:lambda INPUT:%S FOUND" input) + t))) + (`nil + ;; (debug-message "COLLECTION:nil INPUT:%S" input) + (if (not (hash-table-empty-p table)) + (when (gethash input table) + t) + (run-query input) + ;; (debug-message "COLLECTION:nil INPUT:%S KEYS:%S" + ;; input (hash-table-keys table)) + (cond ((hash-table-empty-p table) + nil) + ((gethash input table) + t) + (t + ;; FIXME: "it should return the longest common prefix + ;; substring of all matches otherwise"...but there's no + ;; function to compute that? At least returning an empty + ;; string doesn't seem to break anything. + input)))) + (`(boundaries . ,suffix) + ;; (debug-message "COLLECTION:boundaries INPUT:%S SUFFIX:%S KEYS:%S" + ;; input suffix (hash-table-keys table)) + ;; FIXME: This is unlikely to be correct, but I'm not even sure if it + ;; can be correct in this case since the input (e.g. "todo: foo") + ;; usually won't match a completion candidate directly. + `(boundaries 0 . ,(length suffix))))) (run-query (input) - ;; (debug-message "RUN-QUERY:%S" input) - (when query-prefix - (setf input (concat query-prefix input))) - (unless (or (string-empty-p input) - (equal last-input input)) - ;; (debug-message "RUN-QUERY:%S RUNNING" input) - (setf last-input input) - ;; Clear hash table each time the user changes the input. - (clrhash table) - (clrhash disambiguations) - (when query-filter - (setf input (funcall query-filter input))) - (pcase org-ql-completing-read-snippet-function - ('org-ql-completing-read--snippet-regexp - (setf query-tokens - ;; Remove any tokens that specify predicates or are too short. - (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) - (< (length it) org-ql-completing-read-snippet-minimum-token-length))) - (split-string input nil t (rx space))) - snippet-regexp - (when query-tokens - ;; Limiting each context word to 15 characters prevents - ;; excessively long, non-word strings from ending up in - ;; snippets, which can adversely affect performance. - (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) - bow (or ,@query-tokens) (0+ (not space)) - (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) - (org-ql-select buffers-files (org-ql--query-string-to-sexp input) - :action #'action)))) + ;; (debug-message "RUN-QUERY:%S" input) + (when query-prefix + (setf input (concat query-prefix input))) + (unless (or (string-empty-p input) + (equal last-input input)) + ;; (debug-message "RUN-QUERY:%S RUNNING" input) + (setf last-input input) + ;; Clear hash table each time the user changes the input. + (clrhash table) + (clrhash disambiguations) + (when query-filter + (setf input (funcall query-filter input))) + (pcase org-ql-completing-read-snippet-function + ('org-ql-completing-read--snippet-regexp + (setf query-tokens + ;; Remove any tokens that specify predicates or are too short. + (--select (not (or (string-match-p (rx bos (1+ (not (any ":"))) ":") it) + (< (length it) org-ql-completing-read-snippet-minimum-token-length))) + (split-string input nil t (rx space))) + snippet-regexp + (when query-tokens + ;; Limiting each context word to 15 characters prevents + ;; excessively long, non-word strings from ending up in + ;; snippets, which can adversely affect performance. + (rx-to-string `(seq (optional (repeat 1 3 (repeat 1 15 (not space)) (0+ space))) + bow (or ,@query-tokens) (0+ (not space)) + (optional (repeat 1 3 (0+ space) (repeat 1 15 (not space)))))))))) + (org-ql-select buffers-files (org-ql--query-string-to-sexp input) + :action #'action)))) ;; NOTE: It seems that the `completing-read' machinery can call, abort, and re-call the ;; collection function while the user is typing, which can interrupt the machinery Org uses to ;; prepare an Org buffer when an Org file is loaded. This results in, e.g. the buffer being From be20dc3d5b47f4b01de3db571c936dc4c156e2cb Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 26 Sep 2023 13:41:07 -0500 Subject: [PATCH 14/16] 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 cc926a5..c2dbe85 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 9483c61..dd9fea9 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 f2cf801..61ea89d 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 From 56e203110b3823ff738379fcb910f78eb52d35c5 Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Tue, 26 Sep 2023 20:48:59 -0500 Subject: [PATCH 15/16] Fix: (org-ql-completing-read) Warn about empty headings --- README.org | 1 + org-ql-completing-read.el | 22 ++++++++----- org-ql.info | 65 ++++++++++++++++++++------------------- 3 files changed, 49 insertions(+), 39 deletions(-) diff --git a/README.org b/README.org index c2dbe85..052f8b9 100644 --- a/README.org +++ b/README.org @@ -549,6 +549,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: + 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~. ++ Warn about empty headings in ~org-ql-completing-read~ (the Org format allows a heading line to have no text, but it's useless for this purpose, and usually indicates unnoticed corruption). ** 0.7.1 diff --git a/org-ql-completing-read.el b/org-ql-completing-read.el index 1c7aa71..0c4e70e 100644 --- a/org-ql-completing-read.el +++ b/org-ql-completing-read.el @@ -117,14 +117,20 @@ single predicate)." ;; optional arguments in a certain Org version, so in those versions, it will ;; return priority cookies and comment strings. (let ((heading (org-link-display-format (org-entry-get (point) "ITEM")))) - (when (gethash heading table) - ;; Disambiguate heading (even adding the path isn't enough, because that could - ;; also be duplicated). - (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))))) - (let ((marker (point-marker))) - (puthash (propertize heading 'org-marker marker) marker table)))) + (if (string-empty-p heading) + ;; A heading's string can be empty, but we can't use one because it + ;; wouldn't be useful to the user; and if one is found, it's very + ;; likely to indicate an unnoticed mistake or corruption in the + ;; file: so display a warning and don't record it as a candidate. + (warn "Empty heading at %S in %S" (point) (buffer-name)) + (when (gethash heading table) + ;; Disambiguate heading (even adding the path isn't enough, because that could + ;; also be duplicated). + (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))))) + (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) diff --git a/org-ql.info b/org-ql.info index 61ea89d..066a184 100644 --- a/org-ql.info +++ b/org-ql.info @@ -1038,6 +1038,9 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog (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’. + • Warn about empty headings in ‘org-ql-completing-read’ (the Org + format allows a heading line to have no text, but it’s useless for + this purpose, and usually indicates unnoticed corruption).  File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog @@ -1779,37 +1782,37 @@ Node: Links37257 Node: Tips37944 Node: Changelog38268 Node: 072-pre39053 -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 +Node: 07139972 +Node: 0740785 +Node: 06343709 +Node: 06244240 +Node: 06144545 +Node: 0645113 +Node: 05248167 +Node: 05148467 +Node: 0548890 +Node: 04950421 +Node: 04850703 +Node: 04751052 +Node: 04651461 +Node: 04551869 +Node: 04452230 +Node: 04352589 +Node: 04252792 +Node: 04152953 +Node: 0453200 +Node: 03257301 +Node: 03157704 +Node: 0357901 +Node: 02361201 +Node: 02261435 +Node: 02161715 +Node: 0261920 +Node: 0165998 +Node: Notes66099 +Node: Comparison with Org Agenda searches66261 +Node: org-sidebar67150 +Node: License67429  End Tag Table From f9d4f6241546166f98b5b3b74db4f4532620235a Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Wed, 27 Sep 2023 00:21:21 -0500 Subject: [PATCH 16/16] Release: v0.7.2 --- README.org | 2 +- org-ql.el | 2 +- org-ql.info | 144 ++++++++++++++++++++++++++-------------------------- 3 files changed, 74 insertions(+), 74 deletions(-) diff --git a/README.org b/README.org index 052f8b9..6ff4a0f 100644 --- a/README.org +++ b/README.org @@ -542,7 +542,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like: /Note:/ Breaking changes may be made before version 1.0, but in the event of major changes, attempts at backward compatibility will be made with obsolescence declarations, translation of arguments, etc. Users who need stability guarantees before 1.0 may choose to use tagged stable releases. -** 0.7.2-pre +** 0.7.2 *Fixes* + Timestamp predicates are more tolerant of partial input (e.g. preventing errors while the user is typing a query into ~org-ql-find~). diff --git a/org-ql.el b/org-ql.el index 2a54768..9a3878b 100644 --- a/org-ql.el +++ b/org-ql.el @@ -4,7 +4,7 @@ ;; Author: Adam Porter ;; Url: https://github.com/alphapapa/org-ql -;; Version: 0.7.2-pre +;; Version: 0.7.2 ;; Package-Requires: ((emacs "26.1") (dash "2.18.1") (f "0.17.2") (map "2.1") (org "9.0") (org-super-agenda "1.2") (ov "1.0.6") (peg "1.0.1") (s "1.12.0") (transient "0.1") (ts "0.2-pre")) ;; Keywords: hypermedia, outlines, Org, agenda diff --git a/org-ql.info b/org-ql.info index 066a184..c1e5e13 100644 --- a/org-ql.info +++ b/org-ql.info @@ -71,7 +71,7 @@ Functions / Macros Changelog -* 0.7.2-pre: 072-pre. +* 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -992,7 +992,7 @@ releases. * Menu: -* 0.7.2-pre: 072-pre. +* 0.7.2: 072. * 0.7.1: 071. * 0.7: 07. * 0.6.3: 063. @@ -1022,10 +1022,10 @@ releases. * 0.1: 01.  -File: README.info, Node: 072-pre, Next: 071, Up: Changelog +File: README.info, Node: 072, Next: 071, Up: Changelog -5.1 0.7.2-pre -============= +5.1 0.7.2 +========= *Fixes* • Timestamp predicates are more tolerant of partial input (e.g. @@ -1043,7 +1043,7 @@ File: README.info, Node: 072-pre, Next: 071, Up: Changelog this purpose, and usually indicates unnoticed corruption).  -File: README.info, Node: 071, Next: 07, Prev: 072-pre, Up: Changelog +File: README.info, Node: 071, Next: 07, Prev: 072, Up: Changelog 5.2 0.7.1 ========= @@ -1747,72 +1747,72 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1799 -Node: Screenshots1922 -Node: Installation2040 -Node: Quelpa2554 -Node: Helm support3082 -Node: Usage3485 -Node: Commands3883 -Node: org-ql-find4327 -Node: org-ql-refile4793 -Node: org-ql-search5116 -Node: helm-org-ql6812 -Node: org-ql-view7190 -Node: org-ql-view-sidebar7720 -Node: org-ql-view-recent-items8100 -Node: org-ql-sparse-tree8596 -Node: Queries9396 -Node: Non-sexp query syntax10513 -Node: General predicates12272 -Node: Ancestor/descendant predicates19259 -Node: Date/time predicates20387 -Node: Functions / Macros23511 -Node: Agenda-like views23809 -Ref: Function org-ql-block23971 -Node: Listing / acting-on results25232 -Ref: Caching25440 -Ref: Function org-ql-select26353 -Ref: Function org-ql-query28779 -Ref: Macro org-ql (deprecated)30553 -Node: Custom predicates30868 -Ref: Macro org-ql-defpred31092 -Node: Dynamic block34533 -Node: Links37257 -Node: Tips37944 -Node: Changelog38268 -Node: 072-pre39053 -Node: 07139972 -Node: 0740785 -Node: 06343709 -Node: 06244240 -Node: 06144545 -Node: 0645113 -Node: 05248167 -Node: 05148467 -Node: 0548890 -Node: 04950421 -Node: 04850703 -Node: 04751052 -Node: 04651461 -Node: 04551869 -Node: 04452230 -Node: 04352589 -Node: 04252792 -Node: 04152953 -Node: 0453200 -Node: 03257301 -Node: 03157704 -Node: 0357901 -Node: 02361201 -Node: 02261435 -Node: 02161715 -Node: 0261920 -Node: 0165998 -Node: Notes66099 -Node: Comparison with Org Agenda searches66261 -Node: org-sidebar67150 -Node: License67429 +Node: Contents1791 +Node: Screenshots1914 +Node: Installation2032 +Node: Quelpa2546 +Node: Helm support3074 +Node: Usage3477 +Node: Commands3875 +Node: org-ql-find4319 +Node: org-ql-refile4785 +Node: org-ql-search5108 +Node: helm-org-ql6804 +Node: org-ql-view7182 +Node: org-ql-view-sidebar7712 +Node: org-ql-view-recent-items8092 +Node: org-ql-sparse-tree8588 +Node: Queries9388 +Node: Non-sexp query syntax10505 +Node: General predicates12264 +Node: Ancestor/descendant predicates19251 +Node: Date/time predicates20379 +Node: Functions / Macros23503 +Node: Agenda-like views23801 +Ref: Function org-ql-block23963 +Node: Listing / acting-on results25224 +Ref: Caching25432 +Ref: Function org-ql-select26345 +Ref: Function org-ql-query28771 +Ref: Macro org-ql (deprecated)30545 +Node: Custom predicates30860 +Ref: Macro org-ql-defpred31084 +Node: Dynamic block34525 +Node: Links37249 +Node: Tips37936 +Node: Changelog38260 +Node: 07239037 +Node: 07139944 +Node: 0740753 +Node: 06343677 +Node: 06244208 +Node: 06144513 +Node: 0645081 +Node: 05248135 +Node: 05148435 +Node: 0548858 +Node: 04950389 +Node: 04850671 +Node: 04751020 +Node: 04651429 +Node: 04551837 +Node: 04452198 +Node: 04352557 +Node: 04252760 +Node: 04152921 +Node: 0453168 +Node: 03257269 +Node: 03157672 +Node: 0357869 +Node: 02361169 +Node: 02261403 +Node: 02161683 +Node: 0261888 +Node: 0165966 +Node: Notes66067 +Node: Comparison with Org Agenda searches66229 +Node: org-sidebar67118 +Node: License67397  End Tag Table