Fix: (--pre-process-query) level predicate with args in plain query

Fixes #96.  Thanks to Akira Komamura (@akirak) for reporting.

Released as 0.4.1.
This commit is contained in:
Adam Porter 2020-02-23 23:22:11 -06:00
parent 538373bb48
commit 32c68d7f24
4 changed files with 83 additions and 47 deletions

View file

@ -2,7 +2,7 @@
;; Author: Adam Porter <adam@alphapapa.net>
;; Url: https://github.com/alphapapa/org-ql
;; Version: 0.4
;; Version: 0.4.1
;; Package-Requires: ((emacs "26.1") (dash "2.13") (dash-functional "1.2.0") (f "0.17.2") (org "9.0") (org-super-agenda "1.2-pre") (ov "1.0.6") (peg "0.6") (s "1.12.0") (ts "0.2-pre"))
;; Keywords: hypermedia, outlines, Org, agenda
@ -583,6 +583,16 @@ Replaces bare strings with (regexp) selectors, and appropriate
;; "h" alias.
`(heading ,@args))
;; Outline level.
(`(level . ,args)
;; Arguments could be given as strings (e.g. from a non-Lisp query).
`(level ,@(--map (pcase it
((or "<" "<=" ">" ">=" "=")
(intern it))
((pred stringp) (string-to-number it))
(_ it))
args)))
;; Regexps.
(`(r . ,args)
;; "r" alias.