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,14 +4569,12 @@ 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)))
;; TODO this could show more detail if I wanted (format-action-local-status
(let ((ls (pcase bs-data (local)
(`(:action . ,d) ;; TODO eventually show nested scheduled timestamps
(-let* (((&plist :ancestry a :local l) d) (pcase local
(local-status (`(:sp-proj :proj-active ,_)
(pcase l
(`(:sp-proj :proj-active)
"Active Project") "Active Project")
(`(:sp-proj :proj-wait) (`(:sp-proj :proj-wait)
"Waiting Project") "Waiting Project")
@ -4590,17 +4588,28 @@ FUTURE-LIMIT in a list."
(format-comptime "task" comptime)) (format-comptime "task" comptime))
(`(:sp-task :task-active ,_) (`(:sp-task :task-active ,_)
"Active Task") "Active Task")
(`(:sp-iter :iter-active ,_) (`(:sp-iter :iter-empty :empty-complete ,comptime)
"Active Iterator") (format-comptime "empty iterator" comptime))
(`(:sp-iter :iter-empty) (`(:sp-iter :iter-empty :empty-active)
"Empty Iterator") "Empty and active Iterator")
(`(:sp-iter :iter-complete ,comptime) (`(:sp-iter :iter-nonempty :nonempty-complete ,comptime)
(format-comptime "iterator" comptime)) (format-comptime "nonempty iterator" comptime))
(`(:sp-subiter :si-active ,_) (`(:sp-iter :iter-nonempty :nonempty-active ,_)
"Active sub-iterator") "Nonempty and active iterator")
(`(:sp-subiter :si-complete ,comptime) (`(:sp-subiter :si-proj :proj-complete ,comptime)
(format-comptime "sub-iterator" comptime)) (format-comptime "sub-iterator project" comptime))
(e (error "Unmatched pattern: %s" e)))) (`(: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
(let ((ls (pcase bs-data
(`(:action . ,d)
(-let* (((&plist :ancestry a :local l) d)
(local-status (format-action-local-status l))
((&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")