Merge remote-tracking branch 'origin/master'

This commit is contained in:
Ihor Radchenko 2020-08-10 09:38:01 +08:00
commit 227c3f9945
4 changed files with 126 additions and 63 deletions

View file

@ -412,6 +412,16 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience
*Changed* *Changed*
+ Binding to refresh search/view buffers changed to =r=. + 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 ** 0.4.4
*Fixed* *Fixed*

View file

@ -377,12 +377,12 @@ If NARROW is non-nil, buffer will not be widened."
(message "org-ql: No headings in buffer: %s" (current-buffer))) (message "org-ql: No headings in buffer: %s" (current-buffer)))
nil) nil)
;; Find matching entries. ;; Find matching entries.
(cond (preamble (let ((case-fold-search preamble-case-fold)) (cond (preamble (cl-loop while (let ((case-fold-search preamble-case-fold))
(cl-loop while (re-search-forward preamble nil t) (re-search-forward preamble nil t))
do (outline-back-to-heading 'invisible-ok) do (outline-back-to-heading 'invisible-ok)
when (funcall predicate) when (funcall predicate)
collect (funcall action) collect (funcall action)
do (outline-next-heading)))) do (outline-next-heading)))
(t (cl-loop when (funcall predicate) (t (cl-loop when (funcall predicate)
collect (funcall action) collect (funcall action)
while (outline-next-heading)))))))) while (outline-next-heading))))))))
@ -1671,6 +1671,21 @@ element should be a regexp string."
(defvar peg-errors nil) (defvar peg-errors nil)
(defvar peg-stack 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) (cl-eval-when (compile load eval)
;; This `eval-when' is necessary, otherwise the macro does not define ;; This `eval-when' is necessary, otherwise the macro does not define
;; the function correctly, apparently because `org-ql-predicates' ;; 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. "Return query parsed from plain query string INPUT.
Multiple predicates are combined with BOOLEAN." Multiple predicates are combined with BOOLEAN."
(unless (s-blank-str? input) (unless (s-blank-str? input)
(let* ((query (peg-parse-string (let* ((query (org-ql--peg-parse-string
((query (+ term ((query (+ term
(opt (+ (syntax-class whitespace) (any))))) (opt (+ (syntax-class whitespace) (any)))))
(term (or (and negation (list positive-term) (term (or (and negation (list positive-term)

View file

@ -64,6 +64,8 @@ Functions / Macros
Changelog Changelog
* 0.5-pre: 05-pre. * 0.5-pre: 05-pre.
* 0.4.6: 046.
* 0.4.5: 045.
* 0.4.4: 044. * 0.4.4: 044.
* 0.4.3: 043. * 0.4.3: 043.
* 0.4.2: 042. * 0.4.2: 042.
@ -721,6 +723,8 @@ releases.
* Menu: * Menu:
* 0.5-pre: 05-pre. * 0.5-pre: 05-pre.
* 0.4.6: 046.
* 0.4.5: 045.
* 0.4.4: 044. * 0.4.4: 044.
* 0.4.3: 043. * 0.4.3: 043.
* 0.4.2: 042. * 0.4.2: 042.
@ -736,7 +740,7 @@ releases.
* 0.1: 01. * 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 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. • 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* *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 File: README.info, Node: 043, Next: 042, Prev: 044, Up: Changelog
5.3 0.4.3 5.5 0.4.3
========= =========
*Fixed* *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 File: README.info, Node: 042, Next: 041, Prev: 043, Up: Changelog
5.4 0.4.2 5.6 0.4.2
========= =========
*Fixed* *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 File: README.info, Node: 041, Next: 04, Prev: 042, Up: Changelog
5.5 0.4.1 5.7 0.4.1
========= =========
*Fixed* *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 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 _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 File: README.info, Node: 032, Next: 031, Prev: 04, Up: Changelog
5.7 0.3.2 5.9 0.3.2
========= =========
*Fixed* *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 File: README.info, Node: 031, Next: 03, Prev: 032, Up: Changelog
5.8 0.3.1 5.10 0.3.1
========= ==========
*Fixed* *Fixed*
• Compatibility with Org 9.2. Thanks to Brian Leung • 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 File: README.info, Node: 03, Next: 023, Prev: 031, Up: Changelog
5.9 0.3 5.11 0.3
======= ========
*Added* *Added*
• Alternative, non-sexp query syntax for commands org-ql-search and • 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 File: README.info, Node: 023, Next: 022, Prev: 03, Up: Changelog
5.10 0.2.3 5.12 0.2.3
========== ==========
*Fixed* *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 File: README.info, Node: 022, Next: 021, Prev: 023, Up: Changelog
5.11 0.2.2 5.13 0.2.2
========== ==========
*Fixed* *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 File: README.info, Node: 021, Next: 02, Prev: 022, Up: Changelog
5.12 0.2.1 5.14 0.2.1
========== ==========
*Fixed* *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 File: README.info, Node: 02, Next: 01, Prev: 021, Up: Changelog
5.13 0.2 5.15 0.2
======== ========
*Added* *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 File: README.info, Node: 01, Prev: 02, Up: Changelog
5.14 0.1 5.16 0.1
======== ========
First tagged release. First tagged release.
@ -1136,45 +1165,47 @@ GPLv3
 
Tag Table: Tag Table:
Node: Top225 Node: Top225
Node: Contents1482 Node: Contents1512
Node: Screenshots1605 Node: Screenshots1635
Node: Installation1723 Node: Installation1753
Node: Quelpa2361 Node: Quelpa2391
Node: Usage2804 Node: Usage2834
Node: Commands3153 Node: Commands3183
Node: org-ql-search3626 Node: org-ql-search3656
Node: helm-org-ql5340 Node: helm-org-ql5370
Node: org-ql-view5752 Node: org-ql-view5782
Node: org-ql-view-sidebar6252 Node: org-ql-view-sidebar6282
Node: org-ql-view-recent-items6608 Node: org-ql-view-recent-items6638
Node: org-ql-sparse-tree7092 Node: org-ql-sparse-tree7122
Node: Queries7892 Node: Queries7922
Node: Non-sexp query syntax8800 Node: Non-sexp query syntax8830
Node: General predicates10507 Node: General predicates10537
Node: Ancestor/descendant predicates15722 Node: Ancestor/descendant predicates15752
Node: Date/time predicates16850 Node: Date/time predicates16880
Node: Functions / Macros19505 Node: Functions / Macros19535
Node: Agenda-like views19738 Node: Agenda-like views19768
Node: Listing / acting-on results21143 Node: Listing / acting-on results21173
Node: Changelog25745 Node: Changelog25775
Node: 05-pre26354 Node: 05-pre26414
Node: 04426718 Node: 04626778
Node: 04327078 Node: 04527181
Node: 04227273 Node: 04427540
Node: 04127432 Node: 04327897
Node: 0427671 Node: 04228092
Node: 03231602 Node: 04128251
Node: 03131979 Node: 0428490
Node: 0332174 Node: 03232421
Node: 02335147 Node: 03132798
Node: 02235375 Node: 0332995
Node: 02135643 Node: 02335970
Node: 0235842 Node: 02236198
Node: 0139877 Node: 02136466
Node: Notes39978 Node: 0236665
Node: Comparison with Org Agenda searches40140 Node: 0140700
Node: org-sidebar41012 Node: Notes40801
Node: License41291 Node: Comparison with Org Agenda searches40963
Node: org-sidebar41835
Node: License42114
 
End Tag Table End Tag Table

View file

@ -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-it "with two plain strings in an OR"
(org-ql-expect ((or "Take over" "universe") (org-ql-expect ((or "Take over" "universe")
:sort todo) :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")))) '("Take over the universe" "Take over the world" "Take over Mars" "Take over the moon" "Get haircut"))))
(describe "(scheduled)" (describe "(scheduled)"