ENH update status functions

This commit is contained in:
Nathan Dwarshuis 2022-06-05 12:47:32 -04:00
parent 4ae05ea339
commit cc1b881d40
1 changed files with 37 additions and 28 deletions

View File

@ -4569,38 +4569,47 @@ FUTURE-LIMIT in a list."
(-let* (((&plist :epoch e :canceledp c) comptime) (-let* (((&plist :epoch e :canceledp c) comptime)
((y m d H M) (org-ml-unixtime-to-time-long e)) ((y m d H M) (org-ml-unixtime-to-time-long e))
(verb (if c "Canceled" "Completed"))) (verb (if c "Canceled" "Completed")))
(format-event verb what y m d H M)))) (format-event verb what y m d H M)))
(format-action-local-status
(local)
;; TODO eventually show nested scheduled timestamps
(pcase local
(`(:sp-proj :proj-active ,_)
"Active Project")
(`(:sp-proj :proj-wait)
"Waiting Project")
(`(:sp-proj :proj-held)
"Held Project")
(`(:sp-proj :proj-stuck)
"Stuck Project")
(`(:sp-proj :proj-complete ,comptime)
(format-comptime "project" comptime))
(`(:sp-task :task-complete ,comptime)
(format-comptime "task" comptime))
(`(:sp-task :task-active ,_)
"Active Task")
(`(:sp-iter :iter-empty :empty-complete ,comptime)
(format-comptime "empty iterator" comptime))
(`(:sp-iter :iter-empty :empty-active)
"Empty and active Iterator")
(`(:sp-iter :iter-nonempty :nonempty-complete ,comptime)
(format-comptime "nonempty iterator" comptime))
(`(:sp-iter :iter-nonempty :nonempty-active ,_)
"Nonempty and active iterator")
(`(:sp-subiter :si-proj :proj-complete ,comptime)
(format-comptime "sub-iterator project" comptime))
(`(:sp-subiter :si-task :task-complete ,comptime)
(format-comptime "sub-iterator task" comptime))
(`(:sp-subiter :si-proj :proj-active ,_)
"Active sub-iterator project")
(`(:sp-subiter :si-task :task-active ,_)
"Active sub-iterator task")
(e (error "Unmatched pattern: %s" e)))))
;; TODO this could show more detail if I wanted ;; TODO this could show more detail if I wanted
(let ((ls (pcase bs-data (let ((ls (pcase bs-data
(`(:action . ,d) (`(:action . ,d)
(-let* (((&plist :ancestry a :local l) d) (-let* (((&plist :ancestry a :local l) d)
(local-status (local-status (format-action-local-status l))
(pcase l
(`(:sp-proj :proj-active)
"Active Project")
(`(:sp-proj :proj-wait)
"Waiting Project")
(`(:sp-proj :proj-held)
"Held Project")
(`(:sp-proj :proj-stuck)
"Stuck Project")
(`(:sp-proj :proj-complete ,comptime)
(format-comptime "project" comptime))
(`(:sp-task :task-complete ,comptime)
(format-comptime "task" comptime))
(`(:sp-task :task-active ,_)
"Active Task")
(`(:sp-iter :iter-active ,_)
"Active Iterator")
(`(:sp-iter :iter-empty)
"Empty Iterator")
(`(:sp-iter :iter-complete ,comptime)
(format-comptime "iterator" comptime))
(`(:sp-subiter :si-active ,_)
"Active sub-iterator")
(`(:sp-subiter :si-complete ,comptime)
(format-comptime "sub-iterator" comptime))
(e (error "Unmatched pattern: %s" e))))
((&plist :canceled-parent-p c :held-parent-p h) a) ((&plist :canceled-parent-p c :held-parent-p h) a)
(ancestry-status (cond (ancestry-status (cond
((and c h) "Held/Canceled") ((and c h) "Held/Canceled")