Comment: Add/improve some comments
This commit is contained in:
parent
8a8b74f141
commit
f8a5dc353d
1 changed files with 7 additions and 4 deletions
11
org-ql.el
11
org-ql.el
|
|
@ -316,15 +316,17 @@ replace the clause with a preamble."
|
||||||
(`(or _) element)
|
(`(or _) element)
|
||||||
(`(regexp . ,regexps)
|
(`(regexp . ,regexps)
|
||||||
(setq org-ql-preamble (rx-to-string `(or ,@regexps) t))
|
(setq org-ql-preamble (rx-to-string `(or ,@regexps) t))
|
||||||
;; Return nil
|
;; Return nil, because we don't need to test the predicate.
|
||||||
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
|
||||||
;; can find a non-todo heading named "Waiting".
|
;; heading named "Waiting". For correctness, we could test the predicate
|
||||||
|
;; anyway, but that would negate some of the speed, and in most cases it
|
||||||
|
;; probably won't matter, so I'm leaving it this way for now.
|
||||||
(setq org-ql-preamble
|
(setq org-ql-preamble
|
||||||
(rx-to-string `(seq bol (1+ "*") (1+ space) (or ,@todo-keywords) (or " " eol))
|
(rx-to-string `(seq bol (1+ "*") (1+ space) (or ,@todo-keywords) (or " " eol))
|
||||||
t))
|
t))
|
||||||
;; Return nil
|
;; Return nil, don't test the predicate.
|
||||||
nil)
|
nil)
|
||||||
(`(level ,comparator-or-num ,num)
|
(`(level ,comparator-or-num ,num)
|
||||||
(let ((repeat (pcase comparator-or-num
|
(let ((repeat (pcase comparator-or-num
|
||||||
|
|
@ -334,6 +336,7 @@ replace the clause with a preamble."
|
||||||
('>= `(>= ,num "*"))
|
('>= `(>= ,num "*"))
|
||||||
((pred integerp) `(repeat ,comparator-or-num ,num "*")))))
|
((pred integerp) `(repeat ,comparator-or-num ,num "*")))))
|
||||||
(setq org-ql-preamble (rx-to-string `(seq bol ,repeat " ") t))
|
(setq org-ql-preamble (rx-to-string `(seq bol ,repeat " ") t))
|
||||||
|
;; Return nil, because we don't need to test the predicate.
|
||||||
nil))
|
nil))
|
||||||
(`(level ,num)
|
(`(level ,num)
|
||||||
(setq org-ql-preamble (rx-to-string `(seq bol (repeat ,num "*") " ") t))
|
(setq org-ql-preamble (rx-to-string `(seq bol (repeat ,num "*") " ") t))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue