Add: (heading) Preambles
This commit is contained in:
parent
2f9a7ab6b7
commit
29c3cdd360
1 changed files with 16 additions and 0 deletions
16
org-ql.el
16
org-ql.el
|
|
@ -447,6 +447,22 @@ replace the clause with a preamble."
|
||||||
(setq org-ql-preamble (rx-to-string `(seq bol (0+ space) ":STYLE:" (1+ space)
|
(setq org-ql-preamble (rx-to-string `(seq bol (0+ space) ":STYLE:" (1+ space)
|
||||||
"habit" (0+ space) eol)))
|
"habit" (0+ space) eol)))
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
|
;; Heading text.
|
||||||
|
(`(heading ,regexp)
|
||||||
|
;; Only one regexp: match with preamble only.
|
||||||
|
(setq org-ql-preamble (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl)
|
||||||
|
,regexp)
|
||||||
|
'no-group))
|
||||||
|
nil)
|
||||||
|
(`(heading . ,regexps)
|
||||||
|
;; Multiple regexps: use preamble to match against first
|
||||||
|
;; regexp, then let the predicate match the rest.
|
||||||
|
(setq org-ql-preamble (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl)
|
||||||
|
,(car regexps))
|
||||||
|
'no-group))
|
||||||
|
element)
|
||||||
|
|
||||||
;; Heading levels.
|
;; Heading levels.
|
||||||
(`(level ,comparator-or-num ,num)
|
(`(level ,comparator-or-num ,num)
|
||||||
(let ((repeat (pcase comparator-or-num
|
(let ((repeat (pcase comparator-or-num
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue