Change: (--query-preamble) Simplify (todo) preamble
This commit is contained in:
parent
76ba0afebd
commit
6728ddaaa7
1 changed files with 5 additions and 7 deletions
10
org-ql.el
10
org-ql.el
|
|
@ -288,13 +288,11 @@ replace the clause with a preamble."
|
||||||
(`(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".
|
||||||
(let* ((regexps (--map (list 'regexp
|
(setq org-ql-preamble
|
||||||
(format org-heading-keyword-regexp-format it))
|
(rx-to-string `(seq bol (1+ "*") (1+ space) (or ,@todo-keywords) (or " " eol))
|
||||||
todo-keywords))
|
t))
|
||||||
(regexp (rx-to-string `(or ,@regexps) t)))
|
|
||||||
(setq org-ql-preamble regexp)
|
|
||||||
;; Return nil
|
;; Return nil
|
||||||
nil))
|
nil)
|
||||||
(`(level ,comparator-or-num ,num)
|
(`(level ,comparator-or-num ,num)
|
||||||
(let ((repeat (pcase comparator-or-num
|
(let ((repeat (pcase comparator-or-num
|
||||||
('< `(repeat 1 ,(1- num) "*"))
|
('< `(repeat 1 ,(1- num) "*"))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue