Skip to content

Commit

Permalink
Add: (blocked) predicate
Browse files Browse the repository at this point in the history
  • Loading branch information
akirak authored and alphapapa committed Mar 10, 2023
1 parent e5e9daa commit 6afe3be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ Arguments are listed next to predicate names, where applicable.
+ =tags-regexp (&rest regexps)= :: Return non-nil if current heading has tags matching one or more of ~REGEXPS~. Tests both inherited and local tags.
- Aliases: ~tags*~.
+ =todo (&optional keywords)= :: Return non-nil if current heading is a ~TODO~ item. With ~KEYWORDS~, return non-nil if its keyword is one of ~KEYWORDS~ (a list of strings). When called without arguments, only matches non-done tasks (i.e. does not match keywords in ~org-done-keywords~).
+ =blocked= :: Return non-nil if current heading is blocked.

*** Ancestor/descendant predicates

Expand Down
5 changes: 5 additions & 0 deletions org-ql.el
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,11 @@ any planning prefix); it defaults to 0 (i.e. the whole regexp)."
(from (test-timestamps (ts<= from next-ts)))
(to (test-timestamps (ts<= next-ts to)))))))

(org-ql-defpred blocked ()
"Return non-nil if the entry is blocked."
:body
(org-entry-blocked-p))

;; NOTE: Predicates defined: stop deferring and define normalizer and
;; preamble functions now. Reversing preserves the order in which
;; they were defined. Generally it shouldn't matter, but it might...
Expand Down

0 comments on commit 6afe3be

Please sign in to comment.