Merge: (blocked) predicate

Thanks to Akira Komamura (@akirak).
This commit is contained in:
Adam Porter 2023-03-10 03:42:37 -06:00
commit 7f68db962e
3 changed files with 58 additions and 46 deletions

View file

@ -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. 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). + =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~. + =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=. + =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=.
@ -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). + 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~. + 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 ~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* *Changed*
+ Give more useful error message for invalid queries. + Give more useful error message for invalid queries.

View file

@ -1333,6 +1333,11 @@ result form."
;; redefinitions until all of the predicates have been defined. ;; redefinitions until all of the predicates have been defined.
(setf org-ql-defpred-defer t) (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) (org-ql-defpred (category c) (&rest categories)
"Return non-nil if current heading is in one or more of CATEGORIES." "Return non-nil if current heading is in one or more of CATEGORIES."
:normalizers ((`(,predicate-names . ,rest) :normalizers ((`(,predicate-names . ,rest)

View file

@ -415,6 +415,9 @@ File: README.info, Node: General predicates, Next: Ancestor/descendant predica
Arguments are listed next to predicate names, where applicable. 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) category (&optional categories)
Return non-nil if current heading is in one or more of CATEGORIES Return non-nil if current heading is in one or more of CATEGORIES
(a list of strings). (a list of strings).
@ -1042,6 +1045,8 @@ File: README.info, Node: 07-pre, Next: 063, Up: Changelog
entries with property inheritance, and when unspecified, the option entries with property inheritance, and when unspecified, the option
org-use-property-inheritance controls whether inheritance is org-use-property-inheritance controls whether inheritance is
used. used.
• Predicate blocked. (Thanks to Akira Komamura
(https://github.com/akirak).)
*Changed* *Changed*
• Give more useful error message for invalid queries. • Give more useful error message for invalid queries.
@ -1711,52 +1716,52 @@ Node: org-ql-sparse-tree8594
Node: Queries9394 Node: Queries9394
Node: Non-sexp query syntax10511 Node: Non-sexp query syntax10511
Node: General predicates12270 Node: General predicates12270
Node: Ancestor/descendant predicates19142 Node: Ancestor/descendant predicates19257
Node: Date/time predicates20270 Node: Date/time predicates20385
Node: Functions / Macros23394 Node: Functions / Macros23509
Node: Agenda-like views23692 Node: Agenda-like views23807
Ref: Function org-ql-block23854 Ref: Function org-ql-block23969
Node: Listing / acting-on results25115 Node: Listing / acting-on results25230
Ref: Caching25323 Ref: Caching25438
Ref: Function org-ql-select26236 Ref: Function org-ql-select26351
Ref: Function org-ql-query28662 Ref: Function org-ql-query28777
Ref: Macro org-ql (deprecated)30436 Ref: Macro org-ql (deprecated)30551
Node: Custom predicates30751 Node: Custom predicates30866
Ref: Macro org-ql-defpred30975 Ref: Macro org-ql-defpred31090
Node: Dynamic block34416 Node: Dynamic block34531
Node: Links37140 Node: Links37255
Node: Tips37827 Node: Tips37942
Node: Changelog38151 Node: Changelog38266
Node: 07-pre38934 Node: 07-pre39049
Node: 06341436 Node: 06341645
Node: 06241971 Node: 06242180
Node: 06142276 Node: 06142485
Node: 0642844 Node: 0643053
Node: 05245898 Node: 05246107
Node: 05146198 Node: 05146407
Node: 0546621 Node: 0546830
Node: 04948150 Node: 04948359
Node: 04848430 Node: 04848639
Node: 04748779 Node: 04748988
Node: 04649188 Node: 04649397
Node: 04549596 Node: 04549805
Node: 04449957 Node: 04450166
Node: 04350316 Node: 04350525
Node: 04250519 Node: 04250728
Node: 04150680 Node: 04150889
Node: 0450927 Node: 0451136
Node: 03255028 Node: 03255237
Node: 03155431 Node: 03155640
Node: 0355628 Node: 0355837
Node: 02358928 Node: 02359137
Node: 02259162 Node: 02259371
Node: 02159442 Node: 02159651
Node: 0259647 Node: 0259856
Node: 0163725 Node: 0163934
Node: Notes63826 Node: Notes64035
Node: Comparison with Org Agenda searches63988 Node: Comparison with Org Agenda searches64197
Node: org-sidebar64877 Node: org-sidebar65086
Node: License65156 Node: License65365
 
End Tag Table End Tag Table