From 6afe3be5721d6625eac5bc7c900d88d4ce1387c8 Mon Sep 17 00:00:00 2001 From: Akira Komamura Date: Wed, 28 Jul 2021 17:31:29 +0900 Subject: [PATCH] Add: (blocked) predicate --- README.org | 1 + org-ql.el | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.org b/README.org index 7b66d344..91278897 100644 --- a/README.org +++ b/README.org @@ -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 diff --git a/org-ql.el b/org-ql.el index 3c70b34e..87a090c3 100644 --- a/org-ql.el +++ b/org-ql.el @@ -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...