Change: (--query-preamble) Simplify
This commit is contained in:
parent
6728ddaaa7
commit
06c7f55b21
1 changed files with 5 additions and 7 deletions
10
org-ql.el
10
org-ql.el
|
|
@ -281,10 +281,9 @@ replace the clause with a preamble."
|
||||||
(pcase element
|
(pcase element
|
||||||
(`(or _) element)
|
(`(or _) element)
|
||||||
(`(regexp . ,regexps)
|
(`(regexp . ,regexps)
|
||||||
(let* ((regexp (rx-to-string `(or ,@regexps) t)))
|
(setq org-ql-preamble (rx-to-string `(or ,@regexps) t))
|
||||||
(setq org-ql-preamble regexp)
|
|
||||||
;; Return nil
|
;; Return nil
|
||||||
nil))
|
nil)
|
||||||
(`(todo . ,(and todo-keywords (guard todo-keywords)))
|
(`(todo . ,(and todo-keywords (guard todo-keywords)))
|
||||||
;; FIXME: With case-folding, a query like (todo "WAITING")
|
;; FIXME: With case-folding, a query like (todo "WAITING")
|
||||||
;; can find a non-todo heading named "Waiting".
|
;; can find a non-todo heading named "Waiting".
|
||||||
|
|
@ -303,9 +302,8 @@ replace the clause with a preamble."
|
||||||
(setq org-ql-preamble (rx-to-string `(seq bol ,repeat " ") t))
|
(setq org-ql-preamble (rx-to-string `(seq bol ,repeat " ") t))
|
||||||
nil))
|
nil))
|
||||||
(`(level ,num)
|
(`(level ,num)
|
||||||
(let* ((regexp (rx-to-string `(seq bol (repeat ,num "*") " ") t)))
|
(setq org-ql-preamble (rx-to-string `(seq bol (repeat ,num "*") " ") t))
|
||||||
(setq org-ql-preamble regexp)
|
nil)
|
||||||
nil))
|
|
||||||
(`(and . ,rest)
|
(`(and . ,rest)
|
||||||
(let ((clauses (mapcar #'rec rest)))
|
(let ((clauses (mapcar #'rec rest)))
|
||||||
`(and ,@(-non-nil clauses))))
|
`(and ,@(-non-nil clauses))))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue