ENH split agenda deadlines and scheduled items by planned/unplanned

This commit is contained in:
Nathan Dwarshuis 2022-05-03 19:06:37 -04:00
parent 07daaa0d43
commit 6f936a43b9
1 changed files with 19 additions and 7 deletions

View File

@ -4414,14 +4414,27 @@ In the order of display
(org-x-dag-id->has-node-property-p ,prop ,value))))) (org-x-dag-id->has-node-property-p ,prop ,value)))))
`(:name ,name :order ,order :pred ,f)))) `(:name ,name :order ,order :pred ,f))))
(let ((files '(:action :daily)) (let ((files '(:action :daily))
(conflict-fun (lambda (a) (conflict-fun
(-when-let (i (get-text-property 1 'x-conflict-id a)) (lambda (a)
(->> (org-x-dag-id->title i) (-when-let (i (get-text-property 1 'x-conflict-id a))
(format "Conflict: %s")))))) (->> (org-x-dag-id->title i)
(format "Conflict: %s")))))
(timestamp-fun
(lambda (a)
(let* ((id (get-text-property 1 'x-id a))
(ts-type (get-text-property 1 'type a))
(ns (-some-> (org-x-dag-id->ns id)
(either-from-right nil)
(plist-get :planned))))
(cond
((member ts-type '("past-scheduled" "scheduled"))
(if ns "Scheduled (Planned)" "Scheduled"))
((member ts-type '("upcoming-deadline" "deadline"))
(if ns "Deadlined (Planned)" "Deadlined")))))))
(org-x-dag-agenda-call-inner "Timeblock" 'agenda "" files (org-x-dag-agenda-call-inner "Timeblock" 'agenda "" files
`((org-agenda-sorting-strategy '(time-up category-keep)) `((org-agenda-sorting-strategy '(time-up category-keep))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-map ,conflict-fun :order 5) '((:auto-map ,conflict-fun :order 4)
,(routine-form "Morning Routine" ,(routine-form "Morning Routine"
0 0
org-x-prop-routine org-x-prop-routine
@ -4431,8 +4444,7 @@ In the order of display
org-x-prop-routine org-x-prop-routine
org-x-prop-routine-evening) org-x-prop-routine-evening)
(:name "Calendar" :order 1 :time-grid t) (:name "Calendar" :order 1 :time-grid t)
(:name "Deadlined" :order 3 :deadline t) (:auto-map ,timestamp-fun :order 3))))))))
(:name "Scheduled" :order 4 :scheduled t))))))))
(defun org-x-dag-agenda-goals () (defun org-x-dag-agenda-goals ()
(interactive) (interactive)