Skip to content

Commit

Permalink
Add :done selector
Browse files Browse the repository at this point in the history
Adds selector `:done` that groups items that are done according to
`org-done-keywords`.
  • Loading branch information
Walheimat committed Oct 8, 2024
1 parent c07e354 commit df7b07e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ These selectors take one argument alone, or multiple arguments in a list.
+ =:date= :: Group items that have a date associated. Argument can be =t= to match items with any date, =nil= to match items without a date, or =today= to match items with today’s date. The =ts-date= text-property is matched against.
+ =:deadline= :: Group items that have a deadline. Argument can be ~t~ (to match items with any deadline), ~nil~ (to match items that have no deadline), ~past~ (to match items with a deadline in the past), ~today~ (to match items whose deadline is today), or ~future~ (to match items with a deadline in the future). Argument may also be given like ~before DATE~ or ~after DATE~ where DATE is a date string that ~org-time-string-to-absolute~ can process.
+ =:effort<= :: Group items that are less than (or equal to) the given effort. Argument is a time-duration string, like ~5~ or ~0:05~ for 5 minutes.
+ =:done= :: Group items that are done according to ~org-done-keywords~.
+ =:effort>= :: Group items that are higher than (or equal to) the given effort. Argument is a time-duration string, like ~5~ or ~0:05~ for 5 minutes.
+ ~:file-path~ :: Group items whose buffers' filename paths match any of the given regular expressions.
+ =:habit= :: Group habit items (items which have a =STYLE: habit= Org property).
Expand Down
7 changes: 7 additions & 0 deletions org-super-agenda.el
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,13 @@ keyword, or `nil' to match only non-todo items."
(_ ;; Oops
(user-error "Argument to `:todo' must be a string, list of strings, t, or nil"))))

(org-super-agenda--defgroup done
"Group items that are done according to `org-done-keywords'."
:section-name "Done items"
:test (org-super-agenda--when-with-marker-buffer (org-super-agenda--get-marker item)
(when-let ((state (org-get-todo-state)))
(member state org-done-keywords))))

(org-super-agenda--defgroup ancestor-with-todo
"their earliest ancestor having the to-do keyword"
;; TODO: Add tests.
Expand Down
2 changes: 2 additions & 0 deletions org-super-agenda.info
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,8 @@ list.
Group items that are less than (or equal to) the given effort.
Argument is a time-duration string, like ‘5’ or ‘0:05’ for 5
minutes.
‘:done’
Group items that are done according to ‘org-done-keywords’.
‘:effort>’
Group items that are higher than (or equal to) the given effort.
Argument is a time-duration string, like ‘5’ or ‘0:05’ for 5
Expand Down

0 comments on commit df7b07e

Please sign in to comment.