diff --git a/README.org b/README.org index 7f4022d..e3f0171 100644 --- a/README.org +++ b/README.org @@ -388,6 +388,13 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience *Internal* + Added generic node data cache to speed up recursive, tree-based queries. +** 0.3.2 + +*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 *Fixed* diff --git a/org-ql-search.el b/org-ql-search.el index e7b372d..f79b254 100644 --- a/org-ql-search.el +++ b/org-ql-search.el @@ -212,7 +212,9 @@ necessary." (org-ql-view-super-groups super-groups) (org-ql-view-title title)) (when super-groups - (let ((org-super-agenda-groups super-groups)) + (let ((org-super-agenda-groups (cl-etypecase super-groups + (symbol (symbol-value super-groups)) + (list super-groups)))) (setf strings (org-super-agenda--group-items strings)))) (org-ql-view--display :buffer buffer :header header :string (s-join "\n" strings))))) diff --git a/org-ql-view.el b/org-ql-view.el index 9e57e0d..c17948e 100644 --- a/org-ql-view.el +++ b/org-ql-view.el @@ -147,8 +147,13 @@ See info node `(elisp)Cyclic Window Ordering'." (cons "This week" (lambda () "Show items with an active timestamp during this calendar week." (interactive) - (let* ((beg-of-week (ts-adjust 'day (- (ts-dow (ts-now))) (ts-now))) - (end-of-week (ts-adjust 'day (- 6 (ts-dow (ts-now))) (ts-now)))) + (let* ((ts (ts-now)) + (beg-of-week (->> ts + (ts-adjust 'day (- (ts-dow (ts-now)))) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-week (->> ts + (ts-adjust 'day (- 6 (ts-dow (ts-now)))) + (ts-apply :hour 23 :minute 59 :second 59)))) (org-ql-search (org-agenda-files) `(ts-active :from ,beg-of-week :to ,end-of-week) @@ -159,8 +164,12 @@ See info node `(elisp)Cyclic Window Ordering'." "Show items with an active timestamp during the next calendar week." (interactive) (let* ((ts (ts-adjust 'day 7 (ts-now))) - (beg-of-week (ts-adjust 'day (- (ts-dow (ts-now))) ts)) - (end-of-week (ts-adjust 'day (- 6 (ts-dow (ts-now))) ts))) + (beg-of-week (->> ts + (ts-adjust 'day (- (ts-dow (ts-now)))) + (ts-apply :hour 0 :minute 0 :second 0))) + (end-of-week (->> ts + (ts-adjust 'day (- 6 (ts-dow (ts-now)))) + (ts-apply :hour 23 :minute 59 :second 59)))) (org-ql-search (org-agenda-files) `(ts-active :from ,beg-of-week :to ,end-of-week) diff --git a/org-ql.el b/org-ql.el index 7c63954..a7a0336 100644 --- a/org-ql.el +++ b/org-ql.el @@ -1496,7 +1496,7 @@ Multiple predicates are combined with BOOLEAN." (positive-term (or (and predicate-with-args `(pred args -- (cons (intern pred) args))) (and predicate-without-args `(pred -- (list (intern pred)))) (and plain-string `(s -- (list 'regexp s))))) - (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 24a08be..5f1f532 100644 --- a/tests/test-org-ql.el +++ b/tests/test-org-ql.el @@ -246,6 +246,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\"")