From 7a4a41e402ab97a9a6cc3d09f8dbb975a78b1f2b Mon Sep 17 00:00:00 2001 From: Adam Porter Date: Sat, 19 Oct 2019 01:53:34 -0500 Subject: [PATCH] Fix: Quoted phrase plain-string queries --- README.org | 1 + org-ql.el | 2 +- tests/test-org-ql.el | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.org b/README.org index 270230b..f073f02 100644 --- a/README.org +++ b/README.org @@ -368,6 +368,7 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience *Fixed* + In =org-ql-search=, accept symbol as ~:super-groups~ argument. + In the =This week= and =Next week= default =org-ql-views= views, set timestamps for beginning-of-week to 00:00:00 and end-of-week to 23:59:59. ++ Plain quoted-phrases in non-sexp queries. ** 0.3.1 diff --git a/org-ql.el b/org-ql.el index cbb8137..db1d8d9 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1296,7 +1296,7 @@ Multiple predicates are combined with BOOLEAN." (and predicate-without-args `(pred -- (list (intern pred)))) (and plain-string `(s -- (list 'regexp s)))) (opt (+ (syntax-class whitespace) (any))))) - (plain-string (substring (+ (not (syntax-class whitespace)) (any)))) + (plain-string (or quoted-arg unquoted-arg)) (predicate-with-args (substring predicate) ":" args) (predicate-without-args (substring predicate) ":") (predicate (or ,@predicates)) diff --git a/tests/test-org-ql.el b/tests/test-org-ql.el index c7b95bc..483b703 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -235,6 +235,8 @@ RESULTS should be a list of strings as returned by (expect (org-ql--plain-query "scheduled") ;; No colon after keyword, so not a predicate query. :to-equal '(regexp "scheduled")) + (expect (org-ql--plain-query "\"quoted phrase\"") + :to-equal '(regexp "quoted phrase")) (expect (org-ql--plain-query "regexp:word") :to-equal '(regexp "word")) (expect (org-ql--plain-query "regexp:\"quoted phrase\"")