Change: (regexp) Accept multiple regexps
This commit is contained in:
parent
7068322757
commit
7dcdc21ea1
3 changed files with 19 additions and 4 deletions
|
|
@ -461,14 +461,16 @@ comparator, PRIORITY should be a priority string."
|
|||
"Return non-nil if entry is a habit."
|
||||
(org-is-habit-p))
|
||||
|
||||
(org-ql--defpredicate regexp (regexp)
|
||||
"Return non-nil if current entry matches REGEXP (a regexp string)."
|
||||
(org-ql--defpredicate regexp (&rest regexps)
|
||||
"Return non-nil if current entry matches one of REGEXPS (regexp strings)."
|
||||
(let ((end (or (save-excursion
|
||||
(outline-next-heading))
|
||||
(point-max))))
|
||||
(save-excursion
|
||||
(goto-char (line-beginning-position))
|
||||
(re-search-forward regexp end t))))
|
||||
(cl-loop for regexp in regexps
|
||||
thereis (save-excursion
|
||||
(re-search-forward regexp end t))))))
|
||||
|
||||
(org-ql--defpredicate heading (regexp)
|
||||
"Return non-nil if current entry's heading matches REGEXP (a regexp string)."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue