Change: (regexp) Accept multiple regexps

This commit is contained in:
Adam Porter 2019-07-16 12:33:52 -05:00
parent 7068322757
commit 7dcdc21ea1
3 changed files with 19 additions and 4 deletions

View file

@ -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)."