Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: {not-}done option for :todo selector #268

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.org
Original file line number Diff line number Diff line change
@@ -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).
7 changes: 7 additions & 0 deletions org-super-agenda.el
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 2 additions & 0 deletions org-super-agenda.info
Original file line number Diff line number Diff line change
@@ -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