Add: (org-ql-default-predicate)
This commit is contained in:
parent
c8c89be7bc
commit
0057972069
3 changed files with 42 additions and 30 deletions
12
org-ql.el
12
org-ql.el
|
|
@ -298,6 +298,14 @@ See Info node `(org-ql)Queries'."
|
|||
:type 'boolean
|
||||
:risky t)
|
||||
|
||||
(defcustom org-ql-default-predicate 'regexp
|
||||
"Predicate used for plain-string tokens without a specified predicate."
|
||||
:type '(choice (const heading)
|
||||
(const heading-regexp)
|
||||
(const regexp)
|
||||
(const outline-path)
|
||||
(const outline-path-segment)))
|
||||
|
||||
;;;; Functions
|
||||
|
||||
;;;;; Query execution
|
||||
|
|
@ -862,7 +870,7 @@ value of `org-ql-predicates')."
|
|||
positive-term))
|
||||
(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)))))
|
||||
(and plain-string `(s -- (list org-ql-default-predicate s)))))
|
||||
(plain-string (or quoted-arg unquoted-arg))
|
||||
(predicate-with-args (substring predicate) ":" args)
|
||||
(predicate-without-args (substring predicate) ":")
|
||||
|
|
@ -945,7 +953,7 @@ defined in `org-ql-predicates' by calling `org-ql-defpred'."
|
|||
(`(unless ,condition . ,clauses) `(unless ,(rec condition)
|
||||
,@(mapcar #'rec clauses)))
|
||||
;; TODO: Combine (regexp) when appropriate (i.e. inside an OR, not an AND).
|
||||
((pred stringp) `(regexp ,element))
|
||||
((pred stringp) `(,org-ql-default-predicate ,element))
|
||||
|
||||
,@normalizer-patterns
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue