I think an easy way to implement this would be:
- create a sticky org agenda filtered to
style=habit
- display the first habit's stats by calling
org-habit-stats-view-habit-at-point-agenda on it
- hitting n will go to the next habit in the background, but user only sees next habits stats displayed
The agenda you can get with just:
(let ((org-agenda-sticky t) ;; avoid clobbering users org-agenda in use
(org-agenda-custom-commands
'(("H" "Habits" tags-todo "STYLE=\"habit\""
((org-agenda-overriding-header "*Habits Review*")
(org-agenda-sorting-strategy
'(todo-state-down effort-up category-keep)))))))
(org-agenda nil "H"))
I'm not quite sure how to make a minor (err major?) mode to then use that agenda as I describe above.
Here is elisp code that demonstrates what I mean and works though:
(defun next-habit-and-show-stats ()
(interactive)
(if (progn (next-line) (eobp))
(goto-char (point-min)))
(org-agenda-next-item 1)
(org-habit-stats-view-habit-at-point-agenda))
(defun review-habits ()
(interactive)
(let ((org-agenda-sticky t)
(org-agenda-custom-commands
'(("H" "Habits" tags-todo "STYLE=\"habit\""
((org-agenda-overriding-header "*Habits Review*")
(org-agenda-sorting-strategy
'(todo-state-down effort-up category-keep)))))))
(org-agenda nil "H")
(next-habit-and-show-stats))
(with-current-buffer "*Org Agenda(H:STYLE=\"habit\")*"
(next-habit-and-show-stats)))
I think an easy way to implement this would be:
style=habitorg-habit-stats-view-habit-at-point-agendaon itThe agenda you can get with just:
I'm not quite sure how to make a minor (err major?) mode to then use that agenda as I describe above.
Here is elisp code that demonstrates what I mean and works though: