diff --git a/README.org b/README.org index 8b1f02a..fdc43fc 100644 --- a/README.org +++ b/README.org @@ -412,6 +412,16 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience *Changed* + Binding to refresh search/view buffers changed to =r=. +** 0.4.6 + +*Fixed* ++ Compatibility with newer versions of the =peg= library, which removed a macro used by this package. (Fixes [[https://github.com/alphapapa/org-ql/issues/75][#75]]. Thanks to [[https://github.com/novoid][Karl Voit]] and [[https://github.com/karlicoss][@karlicoss]] for reporting.) + +** 0.4.5 + +*Fixed* ++ Non-case-folding predicates like ~(todo)~ unnecessarily disabled case-folding for other predicates. ([[https://github.com/alphapapa/org-ql/issues/114][Issue #114]]. Thanks to [[https://github.com/bitclick][@bitclick]] for reporting.) + ** 0.4.4 *Fixed* diff --git a/org-ql.el b/org-ql.el index 92d4382..3bcca5c 100644 --- a/org-ql.el +++ b/org-ql.el @@ -377,12 +377,12 @@ If NARROW is non-nil, buffer will not be widened." (message "org-ql: No headings in buffer: %s" (current-buffer))) nil) ;; Find matching entries. - (cond (preamble (let ((case-fold-search preamble-case-fold)) - (cl-loop while (re-search-forward preamble nil t) - do (outline-back-to-heading 'invisible-ok) - when (funcall predicate) - collect (funcall action) - do (outline-next-heading)))) + (cond (preamble (cl-loop while (let ((case-fold-search preamble-case-fold)) + (re-search-forward preamble nil t)) + do (outline-back-to-heading 'invisible-ok) + when (funcall predicate) + collect (funcall action) + do (outline-next-heading))) (t (cl-loop when (funcall predicate) collect (funcall action) while (outline-next-heading)))))))) @@ -1671,6 +1671,21 @@ element should be a regexp string." (defvar peg-errors nil) (defvar peg-stack nil) +(defmacro org-ql--peg-parse-string (rules string &optional noerror) + "Parse STRING according to RULES. +If NOERROR is non-nil, push nil resp. t if the parse failed +resp. succeded instead of signaling an error." + ;; Unfortunately, this macro was moved to peg-tests.el, so we copy it here. + `(with-temp-buffer + (insert ,string) + (goto-char (point-min)) + ,(if noerror + (let ((entry (make-symbol "entry")) + (start (caar rules))) + `(peg-parse (entry (or (and ,start `(-- t)) "")) + . ,rules)) + `(peg-parse . ,rules)))) + (cl-eval-when (compile load eval) ;; This `eval-when' is necessary, otherwise the macro does not define ;; the function correctly, apparently because `org-ql-predicates' @@ -1697,7 +1712,7 @@ Builds the PEG expression using predicates defined in "Return query parsed from plain query string INPUT. Multiple predicates are combined with BOOLEAN." (unless (s-blank-str? input) - (let* ((query (peg-parse-string + (let* ((query (org-ql--peg-parse-string ((query (+ term (opt (+ (syntax-class whitespace) (any))))) (term (or (and negation (list positive-term) diff --git a/org-ql.info b/org-ql.info index 7e7f5a3..1791312 100644 --- a/org-ql.info +++ b/org-ql.info @@ -64,6 +64,8 @@ Functions / Macros Changelog * 0.5-pre: 05-pre. +* 0.4.6: 046. +* 0.4.5: 045. * 0.4.4: 044. * 0.4.3: 043. * 0.4.2: 042. @@ -721,6 +723,8 @@ releases. * Menu: * 0.5-pre: 05-pre. +* 0.4.6: 046. +* 0.4.5: 045. * 0.4.4: 044. * 0.4.3: 043. * 0.4.2: 042. @@ -736,7 +740,7 @@ releases. * 0.1: 01.  -File: README.info, Node: 05-pre, Next: 044, Up: Changelog +File: README.info, Node: 05-pre, Next: 046, Up: Changelog 5.1 0.5-pre =========== @@ -752,9 +756,34 @@ File: README.info, Node: 05-pre, Next: 044, Up: Changelog • Binding to refresh search/view buffers changed to r.  -File: README.info, Node: 044, Next: 043, Prev: 05-pre, Up: Changelog +File: README.info, Node: 046, Next: 045, Prev: 05-pre, Up: Changelog -5.2 0.4.4 +5.2 0.4.6 +========= + +*Fixed* + • Compatibility with newer versions of the peg library, which removed + a macro used by this package. (Fixes #75 + (https://github.com/alphapapa/org-ql/issues/75). Thanks to Karl + Voit (https://github.com/novoid) and @karlicoss + (https://github.com/karlicoss) for reporting.) + + +File: README.info, Node: 045, Next: 044, Prev: 046, Up: Changelog + +5.3 0.4.5 +========= + +*Fixed* + • Non-case-folding predicates like ‘(todo)’ unnecessarily disabled + case-folding for other predicates. (Issue #114 + (https://github.com/alphapapa/org-ql/issues/114). Thanks to + @bitclick (https://github.com/bitclick) for reporting.) + + +File: README.info, Node: 044, Next: 043, Prev: 045, Up: Changelog + +5.4 0.4.4 ========= *Fixed* @@ -766,7 +795,7 @@ File: README.info, Node: 044, Next: 043, Prev: 05-pre, Up: Changelog  File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog -5.3 0.4.3 +5.5 0.4.3 ========= *Fixed* @@ -776,7 +805,7 @@ File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog  File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog -5.4 0.4.2 +5.6 0.4.2 ========= *Fixed* @@ -785,7 +814,7 @@ File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog  File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog -5.5 0.4.1 +5.7 0.4.1 ========= *Fixed* @@ -795,7 +824,7 @@ File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog  File: README.info, Node: 04, Next: 032, Prev: 041, Up: Changelog -5.6 0.4 +5.8 0.4 ======= _Note:_ The next release, 0.5, may include changes which will require @@ -876,7 +905,7 @@ as they will be pushed to the master branch when ready.  File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog -5.7 0.3.2 +5.9 0.3.2 ========= *Fixed* @@ -889,8 +918,8 @@ File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog  File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog -5.8 0.3.1 -========= +5.10 0.3.1 +========== *Fixed* • Compatibility with Org 9.2. Thanks to Brian Leung @@ -899,8 +928,8 @@ File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog  File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog -5.9 0.3 -======= +5.11 0.3 +======== *Added* • Alternative, non-sexp query syntax for commands org-ql-search and @@ -964,7 +993,7 @@ File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog  File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog -5.10 0.2.3 +5.12 0.2.3 ========== *Fixed* @@ -974,7 +1003,7 @@ File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog  File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog -5.11 0.2.2 +5.13 0.2.2 ========== *Fixed* @@ -985,7 +1014,7 @@ File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog  File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog -5.12 0.2.1 +5.14 0.2.1 ========== *Fixed* @@ -995,7 +1024,7 @@ File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog  File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog -5.13 0.2 +5.15 0.2 ======== *Added* @@ -1078,7 +1107,7 @@ File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog  File: README.info, Node: 01, Prev: 02, Up: Changelog -5.14 0.1 +5.16 0.1 ======== First tagged release. @@ -1136,45 +1165,47 @@ GPLv3  Tag Table: Node: Top225 -Node: Contents1482 -Node: Screenshots1605 -Node: Installation1723 -Node: Quelpa2361 -Node: Usage2804 -Node: Commands3153 -Node: org-ql-search3626 -Node: helm-org-ql5340 -Node: org-ql-view5752 -Node: org-ql-view-sidebar6252 -Node: org-ql-view-recent-items6608 -Node: org-ql-sparse-tree7092 -Node: Queries7892 -Node: Non-sexp query syntax8800 -Node: General predicates10507 -Node: Ancestor/descendant predicates15722 -Node: Date/time predicates16850 -Node: Functions / Macros19505 -Node: Agenda-like views19738 -Node: Listing / acting-on results21143 -Node: Changelog25745 -Node: 05-pre26354 -Node: 04426718 -Node: 04327078 -Node: 04227273 -Node: 04127432 -Node: 0427671 -Node: 03231602 -Node: 03131979 -Node: 0332174 -Node: 02335147 -Node: 02235375 -Node: 02135643 -Node: 0235842 -Node: 0139877 -Node: Notes39978 -Node: Comparison with Org Agenda searches40140 -Node: org-sidebar41012 -Node: License41291 +Node: Contents1512 +Node: Screenshots1635 +Node: Installation1753 +Node: Quelpa2391 +Node: Usage2834 +Node: Commands3183 +Node: org-ql-search3656 +Node: helm-org-ql5370 +Node: org-ql-view5782 +Node: org-ql-view-sidebar6282 +Node: org-ql-view-recent-items6638 +Node: org-ql-sparse-tree7122 +Node: Queries7922 +Node: Non-sexp query syntax8830 +Node: General predicates10537 +Node: Ancestor/descendant predicates15752 +Node: Date/time predicates16880 +Node: Functions / Macros19535 +Node: Agenda-like views19768 +Node: Listing / acting-on results21173 +Node: Changelog25775 +Node: 05-pre26414 +Node: 04626778 +Node: 04527181 +Node: 04427540 +Node: 04327897 +Node: 04228092 +Node: 04128251 +Node: 0428490 +Node: 03232421 +Node: 03132798 +Node: 0332995 +Node: 02335970 +Node: 02236198 +Node: 02136466 +Node: 0236665 +Node: 0140700 +Node: Notes40801 +Node: Comparison with Org Agenda searches40963 +Node: org-sidebar41835 +Node: License42114  End Tag Table diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index 8085686..c28d728 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -741,6 +741,13 @@ RESULTS should be a list of strings as returned by (org-ql-it "with two plain strings in an OR" (org-ql-expect ((or "Take over" "universe") :sort todo) + '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut"))) + + (org-ql-it "case-folding predicate with non-case-folding preamble" + ;; e.g. the (todo) predicate disables case-folding in its preamble, but that + ;; should not prevent case-folding in this and other predicates (issue #114). + (org-ql-expect ((and (todo "TODO") (regexp "take over")) + :sort todo) '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut")))) (describe "(scheduled)"