Skip to content

Commit

Permalink
Merge: (blocked) predicate
Browse files Browse the repository at this point in the history
Thanks to Akira Komamura (@akirak).
  • Loading branch information
alphapapa committed Mar 10, 2023
2 parents e5e9daa + 902dad0 commit 7f68db9
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 46 deletions.
2 changes: 2 additions & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,7 @@ Note that the =effort=, =level=, and =priority= predicates do not support compar

Arguments are listed next to predicate names, where applicable.

+ =blocked= :: Return non-nil if current heading is blocked. Calls ~org-entry-blocked-p~, which see.
+ =category (&optional categories)= :: Return non-nil if current heading is in one or more of ~CATEGORIES~ (a list of strings).
+ =done= :: Return non-nil if entry's ~TODO~ keyword is in ~org-done-keywords~.
+ =effort (&optional effort-or-comparator effort)= :: Return non-nil if current heading's effort property matches arguments. The following forms are accepted: ~(effort DURATION)~: Matches if effort is ~DURATION~. ~(effort DURATION DURATION)~: Matches if effort is between DURATIONs, inclusive. ~(effort COMPARATOR DURATION)~: Matches if effort compares to ~DURATION~ with ~COMPARATOR~. ~COMPARATOR~ may be ~<~, ~<=~, ~>~, or ~>=~. ~DURATION~ should be an Org effort string, like =5= or =0:05=.
Expand Down Expand Up @@ -551,6 +552,7 @@ Simple links may also be written manually in either sexp or non-sexp form, like:
+ Option ~org-ql-default-predicate~, applied to plain-string query tokens (before, the ~regexp~ predicate was always used, but now it may be customized).
+ Alias ~c~ for predicate ~category~.
+ Predicate ~property~ now accepts the argument ~:inherit~ to match entries with property inheritance, and when unspecified, the option ~org-use-property-inheritance~ controls whether inheritance is used.
+ Predicate ~blocked~. (Thanks to [[https://github.com/akirak][Akira Komamura]].)

*Changed*
+ Give more useful error message for invalid queries.
Expand Down
5 changes: 5 additions & 0 deletions org-ql.el
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ result form."
;; redefinitions until all of the predicates have been defined.
(setf org-ql-defpred-defer t)

(org-ql-defpred blocked ()
"Return non-nil if entry is blocked.
Calls `org-entry-blocked-p', which see."
:body (org-entry-blocked-p))

(org-ql-defpred (category c) (&rest categories)
"Return non-nil if current heading is in one or more of CATEGORIES."
:normalizers ((`(,predicate-names . ,rest)
Expand Down
97 changes: 51 additions & 46 deletions org-ql.info
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ File: README.info, Node: General predicates, Next: Ancestor/descendant predica

Arguments are listed next to predicate names, where applicable.

‘blocked’
Return non-nil if current heading is blocked. Calls
‘org-entry-blocked-p’, which see.
‘category (&optional categories)’
Return non-nil if current heading is in one or more of ‘CATEGORIES’
(a list of strings).
Expand Down Expand Up @@ -1042,6 +1045,8 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog
entries with property inheritance, and when unspecified, the option
‘org-use-property-inheritance’ controls whether inheritance is
used.
• Predicate ‘blocked’. (Thanks to Akira Komamura
(https://github.com/akirak).)

*Changed*
• Give more useful error message for invalid queries.
Expand Down Expand Up @@ -1711,52 +1716,52 @@ Node: org-ql-sparse-tree8594
Node: Queries9394
Node: Non-sexp query syntax10511
Node: General predicates12270
Node: Ancestor/descendant predicates19142
Node: Date/time predicates20270
Node: Functions / Macros23394
Node: Agenda-like views23692
Ref: Function ‘org-ql-block’23854
Node: Listing / acting-on results25115
Ref: Caching25323
Ref: Function ‘org-ql-select’26236
Ref: Function ‘org-ql-query’28662
Ref: Macro ‘org-ql’ (deprecated)30436
Node: Custom predicates30751
Ref: Macro ‘org-ql-defpred’30975
Node: Dynamic block34416
Node: Links37140
Node: Tips37827
Node: Changelog38151
Node: 07-pre38934
Node: 06341436
Node: 06241971
Node: 06142276
Node: 0642844
Node: 05245898
Node: 05146198
Node: 0546621
Node: 04948150
Node: 04848430
Node: 04748779
Node: 04649188
Node: 04549596
Node: 04449957
Node: 04350316
Node: 04250519
Node: 04150680
Node: 0450927
Node: 03255028
Node: 03155431
Node: 0355628
Node: 02358928
Node: 02259162
Node: 02159442
Node: 0259647
Node: 0163725
Node: Notes63826
Node: Comparison with Org Agenda searches63988
Node: org-sidebar64877
Node: License65156
Node: Ancestor/descendant predicates19257
Node: Date/time predicates20385
Node: Functions / Macros23509
Node: Agenda-like views23807
Ref: Function ‘org-ql-block’23969
Node: Listing / acting-on results25230
Ref: Caching25438
Ref: Function ‘org-ql-select’26351
Ref: Function ‘org-ql-query’28777
Ref: Macro ‘org-ql’ (deprecated)30551
Node: Custom predicates30866
Ref: Macro ‘org-ql-defpred’31090
Node: Dynamic block34531
Node: Links37255
Node: Tips37942
Node: Changelog38266
Node: 07-pre39049
Node: 06341645
Node: 06242180
Node: 06142485
Node: 0643053
Node: 05246107
Node: 05146407
Node: 0546830
Node: 04948359
Node: 04848639
Node: 04748988
Node: 04649397
Node: 04549805
Node: 04450166
Node: 04350525
Node: 04250728
Node: 04150889
Node: 0451136
Node: 03255237
Node: 03155640
Node: 0355837
Node: 02359137
Node: 02259371
Node: 02159651
Node: 0259856
Node: 0163934
Node: Notes64035
Node: Comparison with Org Agenda searches64197
Node: org-sidebar65086
Node: License65365

End Tag Table

Expand Down

0 comments on commit 7f68db9

Please sign in to comment.