Change: (heading) Accept multiple regexps
This commit is contained in:
parent
8a812323fc
commit
8a624bdf0d
2 changed files with 9 additions and 4 deletions
|
|
@ -897,9 +897,11 @@ priority."
|
|||
thereis (save-excursion
|
||||
(re-search-forward regexp end t))))))
|
||||
|
||||
(org-ql--defpred heading (regexp)
|
||||
"Return non-nil if current entry's heading matches REGEXP (a regexp string)."
|
||||
(string-match regexp (org-get-heading 'no-tags 'no-todo)))
|
||||
(org-ql--defpred heading (&rest regexps)
|
||||
"Return non-nil if current entry's heading matches any of REGEXPS (regexp strings)."
|
||||
;; TODO: In Org 9.2+, `org-get-heading' takes 2 more arguments.
|
||||
(let ((heading (org-get-heading 'no-tags 'no-todo)))
|
||||
(--any (string-match it heading) regexps)))
|
||||
|
||||
(org-ql--defpred property (property &optional value)
|
||||
"Return non-nil if current entry has PROPERTY (a string), and optionally VALUE (a string)."
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue