diff --git a/README.org b/README.org index 0c32e91..0311a4e 100644 --- a/README.org +++ b/README.org @@ -488,6 +488,9 @@ Expands into a call to ~org-ql-select~ with the same arguments. For convenience + Predicate =heading= now accepts multiple regexps, which are matched with boolean =AND=. + Predicate =regexp= now matches its regexp arguments with boolean =AND=. +*Fixed* ++ Predicate =heading= now matches only against heading text, i.e. not including tags at the end of the line, to-do keyword, etc. + ** 0.2.1 *Fixed* diff --git a/org-ql.el b/org-ql.el index a80a9d9..f3d611e 100644 --- a/org-ql.el +++ b/org-ql.el @@ -448,12 +448,14 @@ replace the clause with a preamble." nil) ;; Heading text. + ;; MAYBE: Adjust regexp to avoid matching in tag list. (`(heading ,regexp) - ;; Only one regexp: match with preamble only. + ;; Only one regexp: match with preamble, then let predicate confirm (because + ;; the match could be in e.g. the tags rather than the heading text). (setq org-ql-preamble (rx-to-string `(seq bol (1+ "*") (1+ blank) (0+ nonl) ,regexp) 'no-group)) - nil) + element) (`(heading . ,regexps) ;; Multiple regexps: use preamble to match against first ;; regexp, then let the predicate match the rest.