Merge branch 'propagate_scheduled'
This commit is contained in:
commit
bd40a9bbf9
|
@ -668,9 +668,9 @@ used for optimization."
|
|||
(lambda (child-bs)
|
||||
(funcall stop-fun (plist-get child-bs :local)))))
|
||||
|
||||
;; [Status a] -> b -> (a -> a -> Status Bool) -> (a -> Bool) -> (a -> Status b)
|
||||
;; -> Status b
|
||||
(defun org-x-dag-bs-rankfold-children (bss default rank-fun stop-fun trans-fun)
|
||||
;; [Status a] -> b -> (a -> a -> Status Bool) -> (a -> Bool) -> (a -> [c])
|
||||
;; -> (a -> [c] -> Status b) -> Status b
|
||||
(defun org-x-dag-bs-rankfold-children (bss default rank-fun stop-fun acc-fun trans-fun)
|
||||
(declare (indent 2))
|
||||
(let ((err (either :left "Child error")))
|
||||
(cl-labels
|
||||
|
@ -680,26 +680,43 @@ used for optimization."
|
|||
(-let (((x . rest) xs))
|
||||
(pcase x
|
||||
(`(:right ,r)
|
||||
(either>>= (funcall rank-fun acc r)
|
||||
(if (not it) (fold-rank acc rest)
|
||||
(if (funcall stop-fun r) x (fold-rank r rest)))))
|
||||
(-let (((cur as) acc))
|
||||
(either>>= (funcall rank-fun cur r)
|
||||
(let ((as* (append (funcall acc-fun it) as)))
|
||||
(if (not it) (fold-rank `(,cur ,as*) rest)
|
||||
(if (funcall stop-fun r)
|
||||
;; if we encounter the stop condition, apply the
|
||||
;; accumulator function to all remaining rights
|
||||
;; and collect as we break the recursion loop
|
||||
(->> (either-rights rest)
|
||||
(--mapcat (funcall acc-fun it))
|
||||
(append as*)
|
||||
(list r)
|
||||
(either :right))
|
||||
(fold-rank `(,r ,as*) rest)))))))
|
||||
(_ err))))))
|
||||
(if (not bss) (either :right default)
|
||||
(pcase (car bss)
|
||||
(`(:right ,r)
|
||||
(if (funcall stop-fun r) (funcall trans-fun r)
|
||||
(either>>= (fold-rank r (cdr bss))
|
||||
(funcall trans-fun it))))
|
||||
(if (funcall stop-fun r)
|
||||
(->> (funcall acc-fun r)
|
||||
(list)
|
||||
(funcall trans-fun r))
|
||||
(either>>= (fold-rank (list r nil) (cdr bss))
|
||||
(-let (((cur as) it))
|
||||
(funcall trans-fun cur as)))))
|
||||
(_ err))))))
|
||||
|
||||
(defun org-x-dag-bs-action-rankfold-children (bss default rank-fun stop-fun
|
||||
trans-fun)
|
||||
acc-fun trans-fun)
|
||||
(cl-flet ((get-local (x) (plist-get x :local)))
|
||||
(declare (indent 2))
|
||||
(org-x-dag-bs-rankfold-children bss default
|
||||
(-on rank-fun #'get-local)
|
||||
(-compose stop-fun #'get-local)
|
||||
(-compose trans-fun #'get-local))))
|
||||
acc-fun
|
||||
(lambda (x as)
|
||||
(funcall trans-fun (get-local x) as)))))
|
||||
|
||||
(defmacro org-x-dag-left (fmt &rest args)
|
||||
`(either :left (format ,fmt ,@args)))
|
||||
|
@ -782,6 +799,9 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
((new-proj
|
||||
(status)
|
||||
(either :right `(:sp-proj ,status)))
|
||||
(new-active-proj
|
||||
(timestamps)
|
||||
(either :right `(:sp-proj :proj-active (:child-scheds ,timestamps))))
|
||||
(is-next
|
||||
(task-data)
|
||||
(-let (((&plist :todo :sched) task-data))
|
||||
|
@ -826,7 +846,7 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(`((:sp-task :task-active ,a) (:sp-task :task-active ,b))
|
||||
(and (not (is-next a)) (is-next b)))
|
||||
|
||||
(`(,(or `(:sp-proj :proj-active)
|
||||
(`(,(or `(:sp-proj :proj-active ,_)
|
||||
`(:sp-proj :proj-wait)
|
||||
`(:sp-proj :proj-held)
|
||||
`(:sp-proj :proj-stuck)
|
||||
|
@ -836,7 +856,7 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(is-next d))
|
||||
|
||||
(`((:sp-task :task-active ,d)
|
||||
,(or `(:sp-proj :proj-active)
|
||||
,(or `(:sp-proj :proj-active ,_)
|
||||
`(:sp-proj :proj-wait)
|
||||
`(:sp-proj :proj-held)
|
||||
`(:sp-proj :proj-stuck)
|
||||
|
@ -845,8 +865,8 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(not (is-next d)))
|
||||
|
||||
(`((:sp-iter :iter-active ,_) ,_) nil)
|
||||
(`((:sp-proj :proj-active) ,_) nil)
|
||||
(`(,_ (:sp-proj :proj-active)) t)
|
||||
(`((:sp-proj :proj-active ,_) ,_) nil)
|
||||
(`(,_ (:sp-proj :proj-active ,_)) t)
|
||||
(`(,_ (:sp-iter :iter-active ,_)) t)
|
||||
|
||||
(`((:sp-proj :proj-wait) ,_) nil)
|
||||
|
@ -875,23 +895,30 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(`(:sp-task :task-active ,d) (is-next d))
|
||||
(_ nil)))
|
||||
|
||||
(lambda (acc)
|
||||
(lambda (next)
|
||||
(pcase next
|
||||
(`(:sp-iter :iter-active ,d) (plist-get d :child-scheds))
|
||||
(`(:sp-task :task-active ,d) (list (plist-get d :sched)))
|
||||
(`(:sp-proj :proj-active ,d) (plist-get d :child-scheds))
|
||||
(_ nil)))
|
||||
|
||||
(lambda (acc cs)
|
||||
(pcase acc
|
||||
((or `(:sp-proj :proj-complete ,_)
|
||||
`(:sp-task :task-complete ,_)
|
||||
`(:sp-iter :iter-complete ,_))
|
||||
(->> "Active projects must have at least one active child"
|
||||
(either :left )))
|
||||
(`(:sp-proj :proj-active ,_) (new-active-proj cs))
|
||||
(`(:sp-proj ,s) (new-proj s))
|
||||
(`(:sp-iter :iter-active ,_) (new-proj :proj-active))
|
||||
(`(:sp-iter :iter-active ,_) (new-active-proj cs))
|
||||
(`(:sp-iter :iter-empty) (new-proj :proj-stuck))
|
||||
(`(:sp-task :task-active ,d)
|
||||
(-let (((&plist :todo o :sched s) d))
|
||||
(cond
|
||||
((equal o org-x-kw-todo) (->> (if s :proj-active
|
||||
:proj-stuck)
|
||||
(new-proj)))
|
||||
((equal o org-x-kw-next) (new-proj :proj-active))
|
||||
((equal o org-x-kw-todo) (if s (new-active-proj cs)
|
||||
(new-proj :proj-stuck)))
|
||||
((equal o org-x-kw-next) (new-active-proj cs))
|
||||
((equal o org-x-kw-wait) (new-proj :proj-wait))
|
||||
((equal o org-x-kw-hold) (new-proj :proj-held))
|
||||
(t (org-x-dag-bs-error-kw "Task action" o)))))
|
||||
|
@ -906,19 +933,17 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(-when-let (p (alist-get org-x-prop-parent-type props nil nil #'equal))
|
||||
(equal p org-x-prop-parent-type-iterator))))
|
||||
|
||||
;; TODO these next two could be made more efficient by cutting out the
|
||||
;; earlystop form and returning error in the rank form (the trans form is
|
||||
;; still needed in case there is only one child)
|
||||
(defun org-x-dag-bs-action-subiter-complete-fold (child-bss comptime type-name
|
||||
comp-key)
|
||||
(declare (indent 2))
|
||||
success-fun
|
||||
childless-fun)
|
||||
(declare (indent 3))
|
||||
(org-x-dag-bs-action-check-children child-bss
|
||||
(org-x-dag-left "Completed %s cannot have active children" type-name)
|
||||
(either :right `(,comp-key ,comptime))
|
||||
`(,comp-key ,comptime)
|
||||
(either :right (funcall success-fun comptime))
|
||||
(funcall childless-fun comptime)
|
||||
(lambda (local)
|
||||
(pcase local
|
||||
(`(:si-complete ,_) t)
|
||||
((or `(:si-task :task-complete ,_) `(:si-proj :proj-complete ,_)) t)
|
||||
(_ nil)))))
|
||||
|
||||
(defun org-x-dag-bs-action-subiter-todo-fold (child-bss default trans-fun)
|
||||
|
@ -926,7 +951,8 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(org-x-dag-bs-action-rankfold-children child-bss default
|
||||
(lambda (acc next)
|
||||
(pcase `(,acc ,next)
|
||||
(`((:si-active ,a) (:si-active ,b))
|
||||
;; for active tasks, the furthest in the future is ranked the highest
|
||||
(`((:si-task :task-active ,a) (:si-task :task-active ,b))
|
||||
(-let (((&plist :sched as :dead ad) a)
|
||||
((&plist :sched bs :dead bd) b))
|
||||
(cond
|
||||
|
@ -949,12 +975,22 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(->> (org-x-dag-datetime< (org-ml-timestamp-get-start-time as)
|
||||
(org-ml-timestamp-get-start-time bs))
|
||||
(either :right))))))
|
||||
(`((:si-active ,_) ,_) (either :right nil))
|
||||
(`(,_ (:si-active ,_)) (either :right t))
|
||||
((or `((:si-task . ,_) (:si-proj . ,_))
|
||||
`((:si-proj . ,_) (:si-task . ,_)))
|
||||
(either :left "Sub-iterators must have same project structure"))
|
||||
(`(,(or `(:si-task :task-active ,_) `(:si-proj :proj-active ,_)) ,_)
|
||||
(either :right nil))
|
||||
(`(,_ ,(or `(:si-task :task-active ,_) `(:si-proj :proj-active ,_)))
|
||||
(either :right t))
|
||||
(`(,_ ,_) (either :right nil))))
|
||||
(lambda (next)
|
||||
(pcase next
|
||||
(`(:si-active ,_) t)
|
||||
((or `(:si-task :task-active ,_) `(:si-proj :proj-active ,_)) t)
|
||||
(_ nil)))
|
||||
(lambda (next)
|
||||
(pcase next
|
||||
(`(:si-proj :proj-active ,d) (plist-get d :child-scheds))
|
||||
(`(:si-task :task-active ,d) (list (plist-get d :sched)))
|
||||
(_ nil)))
|
||||
trans-fun))
|
||||
|
||||
|
@ -962,53 +998,84 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(org-x-dag-node-data-is-iterator-p (plist-get node :node-meta)))
|
||||
|
||||
(defun org-x-dag-bs-action-subiter-inner (node-data ancestry child-bss)
|
||||
(org-x-dag-bs-action-with-closed node-data ancestry "sub-iterators"
|
||||
`(:si-complete ,it-comptime)
|
||||
(org-x-dag-bs-action-subiter-complete-fold child-bss it-comptime
|
||||
"sub-iterators" :si-complete)
|
||||
(-let (((sched dead) (-some->> it-planning
|
||||
(org-ml-get-properties '(:scheduled :deadline)))))
|
||||
(cond
|
||||
((and sched child-bss)
|
||||
(either :left "Sub-iterators with children cannot be scheduled"))
|
||||
((and dead child-bss)
|
||||
(either :left "Sub-iterators with children cannot be deadlined"))
|
||||
((org-x-dag-node-data-is-iterator-p node-data)
|
||||
(either :left "Iterators cannot be nested"))
|
||||
((org-x-dag-action-dead-after-parent-p ancestry dead)
|
||||
(either :left "Sub-iterator deadline must not start after parent"))
|
||||
((equal it-todo org-x-kw-todo)
|
||||
(org-x-dag-bs-action-subiter-todo-fold child-bss
|
||||
`(:si-active (:sched ,sched :dead ,dead))
|
||||
(lambda (acc)
|
||||
(pcase acc
|
||||
(`(:si-complete ,_)
|
||||
(org-x-dag-left "Active sub-iterator must have at least one active child"))
|
||||
(`(:si-active ,ts-data)
|
||||
(either :right `(:si-active ,ts-data)))
|
||||
(e (error "Invalid pattern: %s" e))))))
|
||||
(t
|
||||
(org-x-dag-bs-error-kw "Sub-iterator" it-todo))))))
|
||||
(cl-flet
|
||||
((new-active-proj
|
||||
(d s cs)
|
||||
(->> (list :dead d :child-scheds cs :leading-sched s)
|
||||
(list :si-proj :proj-active)
|
||||
(either :right))))
|
||||
(org-x-dag-bs-action-with-closed node-data ancestry "sub-iterators"
|
||||
(if child-bss
|
||||
`(:si-proj :proj-complete ,it-comptime)
|
||||
`(:si-task :task-complete ,it-comptime))
|
||||
|
||||
(org-x-dag-bs-action-subiter-complete-fold child-bss it-comptime
|
||||
"sub-iterators"
|
||||
(lambda (c) `(:si-proj :proj-complete ,c))
|
||||
(lambda (c) `(:si-task :task-complete ,c)))
|
||||
|
||||
(-let (((sched dead) (-some->> it-planning
|
||||
(org-ml-get-properties '(:scheduled :deadline)))))
|
||||
(cond
|
||||
((and sched child-bss)
|
||||
(either :left "Project sub-iterators cannot be scheduled"))
|
||||
((and dead child-bss)
|
||||
(either :left "Project sub-iterators cannot be deadlined"))
|
||||
((org-x-dag-node-data-is-iterator-p node-data)
|
||||
(either :left "Iterators cannot be nested"))
|
||||
((org-x-dag-action-dead-after-parent-p ancestry dead)
|
||||
(either :left "Sub-iterator deadline must not start after parent"))
|
||||
((equal it-todo org-x-kw-todo)
|
||||
(org-x-dag-bs-action-subiter-todo-fold child-bss
|
||||
`(:si-task :task-active (:sched ,sched :dead ,dead))
|
||||
(lambda (acc cs)
|
||||
(pcase acc
|
||||
((or `(:si-proj :proj-complete ,_)
|
||||
`(:si-task :task-complete ,_))
|
||||
(-> "Active sub-iterator must have at least one active child"
|
||||
(org-x-dag-left)))
|
||||
(`(:si-proj :proj-active ,ts-data)
|
||||
(-let (((&plist :dead d :leading-sched s) ts-data))
|
||||
(new-active-proj d s cs)))
|
||||
(`(:si-task :task-active ,ts-data)
|
||||
(-let (((&plist :dead d :sched s) ts-data))
|
||||
(new-active-proj d s cs)))
|
||||
(e (error "Invalid pattern: %s" e))))))
|
||||
(t
|
||||
(org-x-dag-bs-error-kw "Sub-iterator" it-todo)))))))
|
||||
|
||||
(defun org-x-dag-bs-action-iter-inner (node-data ancestry child-bss)
|
||||
(org-x-dag-bs-action-with-closed node-data ancestry "iterators"
|
||||
`(:iter-complete ,it-comptime)
|
||||
(org-x-dag-bs-action-subiter-complete-fold child-bss it-comptime
|
||||
"iterators" :iter-complete)
|
||||
(cond
|
||||
(it-planning
|
||||
(either :left "Iterators cannot be scheduled or deadlined"))
|
||||
;; TODO also check for timeshift and archive props
|
||||
((equal it-todo org-x-kw-todo)
|
||||
(org-x-dag-bs-action-subiter-todo-fold child-bss '(:iter-empty)
|
||||
(lambda (acc)
|
||||
(pcase acc
|
||||
(`(:si-complete ,_) (either :right '(:iter-empty)))
|
||||
(`(:si-active ,ts-data)
|
||||
(either :right `(:iter-active ,ts-data)))
|
||||
(e (error "Invalid pattern: %s" e))))))
|
||||
(t
|
||||
(org-x-dag-bs-error-kw "Iterator" it-todo)))))
|
||||
(cl-flet
|
||||
((new-active-iter
|
||||
(d s cs)
|
||||
(->> (list :dead d :child-scheds cs :leading-sched s)
|
||||
(list :iter-nonempty :nonempty-active)
|
||||
(either :right))))
|
||||
(org-x-dag-bs-action-with-closed node-data ancestry "iterators"
|
||||
`(:iter-empty :empty-complete ,it-comptime)
|
||||
(org-x-dag-bs-action-subiter-complete-fold child-bss it-comptime "iterators"
|
||||
(lambda (c) `(:iter-nonempty :nonempty-complete ,c))
|
||||
(lambda (c) `(:iter-empty :empty-complete ,c)))
|
||||
(cond
|
||||
(it-planning
|
||||
(either :left "Iterators cannot be scheduled or deadlined"))
|
||||
;; TODO also check for timeshift and archive props
|
||||
((equal it-todo org-x-kw-todo)
|
||||
(org-x-dag-bs-action-subiter-todo-fold child-bss '(:iter-empty :empty-active)
|
||||
(lambda (acc cs)
|
||||
(pcase acc
|
||||
((or `(:si-task :task-complete ,_)
|
||||
`(:si-proj :proj-complete ,_))
|
||||
(either :right '(:iter-nonempty :nonempty-complete)))
|
||||
(`(:si-task :task-active ,ts-data)
|
||||
(-let (((&plist :dead d :sched s) ts-data))
|
||||
(new-active-iter d s cs)))
|
||||
(`(:si-proj :proj-active ,ts-data)
|
||||
(-let (((&plist :dead d :leading-sched s) ts-data))
|
||||
(new-active-iter d s cs)))
|
||||
(e (error "Invalid pattern: %s" e))))))
|
||||
(t
|
||||
(org-x-dag-bs-error-kw "Iterator" it-todo))))))
|
||||
|
||||
(defun org-x-dag-bs-epg-inner (node ancestry child-bss)
|
||||
(let ((is-complete
|
||||
|
@ -1241,7 +1308,7 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(mk-right dead)
|
||||
(->> "QTP deadlines must be due after the quarter starts"
|
||||
(either :left))))
|
||||
(mk-right nil date-abs)))
|
||||
(mk-right nil)))
|
||||
(t
|
||||
(org-x-dag-bs-error-kw "QTP" it-todo)))))))
|
||||
|
||||
|
@ -1461,9 +1528,24 @@ deadline (eg via epoch time) or if it has a repeater."
|
|||
(-some->> (org-x-dag-adjlist-id-hl-meta-prop adjlist :planning id)
|
||||
(org-ml-get-property which)))
|
||||
|
||||
(defun org-x-dag-adjlist-id-planning-datetime (adjlist which id)
|
||||
(-some->> (org-x-dag-adjlist-id-planning adjlist which id)
|
||||
(org-ml-timestamp-get-start-time)))
|
||||
;; (defun org-x-dag-adjlist-id-planning-datetime (adjlist which id)
|
||||
;; (-some->> (org-x-dag-adjlist-id-planning adjlist which id)
|
||||
;; (org-ml-timestamp-get-start-time)))
|
||||
|
||||
(defun org-x-dag-adjlist-id-all-sched (adjlist id)
|
||||
(-when-let (bs (-> (org-x-dag-adjlist-id-bs adjlist id)
|
||||
(either-from-right nil)))
|
||||
(pcase bs
|
||||
(`(:sp-task :task-active ,d)
|
||||
(-some-> (plist-get d :sched) (list)))
|
||||
(`(:sp-subiter :si-task :task-active ,d)
|
||||
(-some-> (plist-get d :sched) (list)))
|
||||
(`(:sp-proj :proj-active ,d)
|
||||
(plist-get d :child-scheds))
|
||||
(`(:sp-subiter :si-proj :proj-active ,d)
|
||||
(plist-get d :child-scheds))
|
||||
(`(:sp-iter :iter-nonempty :nonempty-active ,d)
|
||||
(plist-get d :child-scheds)))))
|
||||
|
||||
(defun org-x-dag-adjlist-id-todo (adjlist id)
|
||||
(org-x-dag-adjlist-id-hl-meta-prop adjlist :todo id))
|
||||
|
@ -1677,8 +1759,8 @@ denoted by CUR-KEY with any errors that are found."
|
|||
(put-scheduled-action-maybe
|
||||
(lambda (id committed-ids)
|
||||
;; TODO what about repeaters?
|
||||
(-when-let (sched (org-x-dag-adjlist-id-planning-datetime
|
||||
adjlist :scheduled id))
|
||||
;; TODO check these to see if they are in the planning period
|
||||
(-when-let (scheds (org-x-dag-adjlist-id-all-sched adjlist id))
|
||||
(when (and (not (org-x-dag-adjlist-id-done-p adjlist id))
|
||||
committed-ids)
|
||||
(->> q-committed
|
||||
|
@ -2502,12 +2584,13 @@ Return value is a list like (BUFFER NON-BUFFER)."
|
|||
"Return t if ID has no buffer children."
|
||||
(not (org-x-dag-id->buffer-children id)))
|
||||
|
||||
(defun org-x-dag-id->is-active-iterator-child-p (id)
|
||||
(-> (org-x-dag-id->buffer-parent id)
|
||||
(org-x-dag-id->bs)
|
||||
(either-from-right nil)
|
||||
(cadr)
|
||||
(eq :iter-active)))
|
||||
(defun org-x-dag-id->is-active-toplevel-iterator-child-p (id)
|
||||
(-when-let (parent (org-x-dag-id->buffer-parent id))
|
||||
(-when-let (parent-bs (-> (org-x-dag-id->bs parent)
|
||||
(either-from-right nil)))
|
||||
(pcase (plist-get (cdr parent-bs) :local)
|
||||
(`(:sp-iter :iter-nonempty :nonempty-active ,_)
|
||||
(org-x-dag-id->is-toplevel-p parent))))))
|
||||
|
||||
(defun org-x-dag-id->has-node-property-p (prop value id)
|
||||
(->> (alist-get prop (org-x-dag-id->node-properties id) nil nil #'equal)
|
||||
|
@ -3041,9 +3124,10 @@ FUTURE-LIMIT in a list."
|
|||
((get-status
|
||||
(data)
|
||||
(pcase data
|
||||
(`(:iter-empty) :empty)
|
||||
(`(:iter-active ,data)
|
||||
(-let* (((&plist :dead d :sched s) data)
|
||||
(`(:iter-empty :empty-complete ,_) :complete)
|
||||
(`(:iter-empty :empty-active ,_) :empty)
|
||||
(`(:iter-nonempty :nonempty-active ,data)
|
||||
(-let* (((&plist :dead d :leading-sched s) data)
|
||||
(d* (-some->> d (org-x-dag-timestamp-to-epoch)))
|
||||
(s* (-some->> s (org-x-dag-timestamp-to-epoch))))
|
||||
(-if-let (epoch (if (and d* s*) (min d* s*) (or s* d*)))
|
||||
|
@ -3052,7 +3136,7 @@ FUTURE-LIMIT in a list."
|
|||
:active
|
||||
:refill)
|
||||
:unknown)))
|
||||
(`(:iter-complete ,_) :complete))))
|
||||
(`(:iter-nonempty :nonempty-complete ,_) :complete))))
|
||||
(org-x-dag-with-unmasked-action-ids files
|
||||
(pcase it-local
|
||||
(`(:sp-iter . ,status-data)
|
||||
|
@ -3068,8 +3152,10 @@ FUTURE-LIMIT in a list."
|
|||
(-when-let (type (pcase it-local
|
||||
(`(:sp-proj :proj-complete ,_) nil)
|
||||
(`(:sp-task :task-complete ,_) nil)
|
||||
(`(:sp-iter :iter-complete ,_) nil)
|
||||
(`(:sp-subiter :si-complete ,_) nil)
|
||||
(`(:sp-iter :iter-empty :empty-complete ,_) nil)
|
||||
(`(:sp-iter :iter-nonempty :nonempty-complete ,_) nil)
|
||||
(`(:sp-subiter :si-proj :proj-complete ,_) nil)
|
||||
(`(:sp-subiter :si-task :task-complete ,_) nil)
|
||||
(`(:sp-proj . ,_) :proj)
|
||||
(`(:sp-task . ,_ ) :task)
|
||||
(`(:sp-iter . ,_) :iter)
|
||||
|
@ -3214,25 +3300,33 @@ FUTURE-LIMIT in a list."
|
|||
|
||||
(defun org-x-dag-itemize-archived (files)
|
||||
(org-x-dag-with-unmasked-action-ids files
|
||||
(-let (((comptime type)
|
||||
(pcase it-local
|
||||
(`(:sp-proj :proj-complete ,c) `(,c :proj))
|
||||
(`(:sp-task :task-complete ,c) `(,c :task))
|
||||
(`(:sp-iter :iter-complete ,c) `(,c :iter))
|
||||
(`(:sp-subiter :si-complete ,c) `(,c :subiter)))))
|
||||
(when (and comptime
|
||||
(or (and (memq type '(:proj :task))
|
||||
(org-x-dag-id->is-toplevel-p it))
|
||||
(eq type :iter)
|
||||
(and (eq type :subiter)
|
||||
(org-x-dag-id->is-active-iterator-child-p it))))
|
||||
(-let ((epoch (plist-get comptime :epoch)))
|
||||
(when (org-x-dag-time-is-archivable-p epoch)
|
||||
(let ((tags (org-x-dag-id->tags it)))
|
||||
(-> (org-x-dag-format-tag-node tags it)
|
||||
(org-add-props nil
|
||||
'x-type type)
|
||||
(list)))))))))
|
||||
(-when-let (r (pcase it-local
|
||||
(`(:sp-proj :proj-complete ,c)
|
||||
(when (org-x-dag-id->is-toplevel-p it)
|
||||
`(,c :proj)))
|
||||
(`(:sp-task :task-complete ,c)
|
||||
(when (org-x-dag-id->is-toplevel-p it)
|
||||
`(,c :task)))
|
||||
(`(:sp-iter :iter-empty :empty-complete ,c)
|
||||
(when (org-x-dag-id->is-toplevel-p it)
|
||||
`(,c :iter-empty)))
|
||||
(`(:sp-iter :iter-nonempty :nonempty-complete ,c)
|
||||
(when (org-x-dag-id->is-toplevel-p it)
|
||||
`(,c :iter-nonempty)))
|
||||
(`(:sp-subiter :si-proj :proj-complete ,c)
|
||||
(when (org-x-dag-id->is-active-toplevel-iterator-child-p it)
|
||||
`(,c :subiter-proj)))
|
||||
(`(:sp-subiter :si-task :task-complete ,c)
|
||||
(when (org-x-dag-id->is-active-toplevel-iterator-child-p it)
|
||||
`(,c :subiter-task)))))
|
||||
(-let* (((comptime type) r)
|
||||
(epoch (plist-get comptime :epoch)))
|
||||
(when (org-x-dag-time-is-archivable-p epoch)
|
||||
(let ((tags (org-x-dag-id->tags it)))
|
||||
(-> (org-x-dag-format-tag-node tags it)
|
||||
(org-add-props nil
|
||||
'x-type type)
|
||||
(list))))))))
|
||||
|
||||
(defun org-x-dag-itemize-errors (files)
|
||||
(cl-flet
|
||||
|
@ -3349,9 +3443,9 @@ FUTURE-LIMIT in a list."
|
|||
(ss (scheduled-datetimes id donep)))
|
||||
`(,acc-d (,@ss ,@acc-s))))
|
||||
(add-dead
|
||||
(acc id donep)
|
||||
(acc id)
|
||||
(-let (((acc-d acc-s) acc)
|
||||
(ds (deadlined-datetimes id donep)))
|
||||
(ds (deadlined-datetimes id nil)))
|
||||
`((,@ds ,@acc-d) ,acc-s)))
|
||||
(add-dead-sched
|
||||
(acc id donep)
|
||||
|
@ -3376,18 +3470,17 @@ FUTURE-LIMIT in a list."
|
|||
(plist-get a :held-parent-p))
|
||||
acc
|
||||
(pcase l
|
||||
(`(:sp-proj ,(or :proj-active
|
||||
:proj-wait
|
||||
:proj-held
|
||||
:proj-stuck))
|
||||
(add-dead acc id nil))
|
||||
(`(:sp-task :task-active ,_)
|
||||
((or `(:sp-proj :proj-active ,_)
|
||||
`(:sp-subiter :si-proj :proj-active ,_)
|
||||
`(:sp-proj ,(or :proj-wait
|
||||
:proj-held
|
||||
:proj-stuck)))
|
||||
(add-dead acc id))
|
||||
((or `(:sp-task :task-active ,_)
|
||||
`(:sp-subiter :si-task :task-active ,_))
|
||||
(add-dead-sched acc id nil))
|
||||
(`(:sp-task :task-complete ,_)
|
||||
(add-dead-sched acc id t))
|
||||
(`(:sp-subiter :si-active ,_)
|
||||
(add-dead-sched acc id nil))
|
||||
(`(:sp-subiter :si-complete ,_)
|
||||
((or `(:sp-task :task-complete ,_)
|
||||
`(:sp-subiter :si-task :task-complete ,_))
|
||||
(add-dead-sched acc id t))
|
||||
(_ acc)))))
|
||||
(_ acc)))
|
||||
|
@ -4487,38 +4580,47 @@ FUTURE-LIMIT in a list."
|
|||
(-let* (((&plist :epoch e :canceledp c) comptime)
|
||||
((y m d H M) (org-ml-unixtime-to-time-long e))
|
||||
(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
|
||||
(let ((ls (pcase bs-data
|
||||
(`(:action . ,d)
|
||||
(-let* (((&plist :ancestry a :local l) d)
|
||||
(local-status
|
||||
(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))))
|
||||
(local-status (format-action-local-status l))
|
||||
((&plist :canceled-parent-p c :held-parent-p h) a)
|
||||
(ancestry-status (cond
|
||||
((and c h) "Held/Canceled")
|
||||
|
@ -5078,7 +5180,7 @@ review phase)"
|
|||
(let ((s (get-text-property 1 'x-status line)))
|
||||
(pcase s
|
||||
(:unknown "0. Unknown")
|
||||
(:complete "1. Refill")
|
||||
(:complete "1. Complete")
|
||||
(:empty "2. Empty")
|
||||
(:refill "3. Refill")
|
||||
(:active "4. Active")))))))))))
|
||||
|
@ -5110,8 +5212,10 @@ review phase)"
|
|||
(cl-case (get-text-property 1 'x-type line)
|
||||
(:proj "Toplevel Projects")
|
||||
(:task "Standalone Tasks")
|
||||
(:iter "Closed Iterators")
|
||||
(:subiter "Toplevel Subiterators"))))))))))
|
||||
(:iter-empty "Closed Empty Iterators")
|
||||
(:iter-nonempty "Closed Active Iterators")
|
||||
(:subiter-proj "Toplevel Subiterator Projects")
|
||||
(:subiter-task "Toplevel Subiterator Tasks"))))))))))
|
||||
|
||||
;; ;; TODO the tags in the far column are redundant
|
||||
;; (defun org-x-dag-agenda-quarterly-plan ()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
(("ESS" . "39eba283000a7b0220303d7c5a4f3ee05efc1e9c")
|
||||
(("ESS" . "e83ac622fe7e3cbfc848481a9257e5ed5c7b5afb")
|
||||
("Highlight-Indentation-for-Emacs" . "d88db4248882da2d4316e76ed673b4ac1fa99ce3")
|
||||
("ace-window" . "0577c426a9833ab107bab46c60d1885c611b2fb9")
|
||||
("anaconda-mode" . "cbea0fb3182321d34ff93981c5a59f8dd72d82a5")
|
||||
|
@ -8,9 +8,9 @@
|
|||
("avy" . "ba5f035be33693d1a136a5cbeedb24327f551a92")
|
||||
("beacon" . "bde78180c678b233c94321394f46a81dc6dce1da")
|
||||
("biblio.el" . "517ec18f00f91b61481214b178f7ae0b8fbc499b")
|
||||
("blacken" . "563c744f545552cb92e8e84d5be4e2cdbabc93ca")
|
||||
("blacken" . "764912ada13c3bf57e770fcd978c81a1ce26666a")
|
||||
("c-eldoc" . "f4ede1f37f6de583376669735326367d84a0a917")
|
||||
("cider" . "0d2ba20c029b12582e5fa318f046f2feddc1b270")
|
||||
("cider" . "df34f141f32739e3c5657fb85ad6ff23520d44bf")
|
||||
("citeproc-el" . "ba49516265fa24b138346c4918d39d19b4de8a62")
|
||||
("clang-format" . "e48ff8ae18dc7ab6118c1f6752deb48cb1fc83ac")
|
||||
("clojure-mode" . "b6f41d74904daa9312648f3a7bea7a72fd8e140b")
|
||||
|
@ -20,45 +20,45 @@
|
|||
("company-irony" . "b44711dfce445610c1ffaec4951c6ff3882b216a")
|
||||
("company-math" . "45778f5731c97a21a83e3b965cbde42018709afd")
|
||||
("company-mode" . "d5145006b948f93e673f439a766da01f636d39fc")
|
||||
("compat" . "1753ad6043a826ad7639dc99f3dd47ba59b6be79")
|
||||
("compat" . "81378ce2549e6c6df5141d459036438cb98b9ad3")
|
||||
("conda.el" . "7a34e06931515d46f9e22154762e06e66cfbc81c")
|
||||
("csv-mode" . "53beddc207864b0c3f81da85b59245dff8eea5ce")
|
||||
("dash.el" . "759682332a0ebd737802d9fa0a80ceedf05088b6")
|
||||
("dash.el" . "f9e6602ac9966b74a5ba6e3d332535543c84f4d5")
|
||||
("delight" . "70cb8cec9e5eb2c24364e065d85c2ea8f14a587c")
|
||||
("dired-du" . "4ce114a0195b852022a81b05f0c8e0cbbc1ed013")
|
||||
("dired-hacks" . "7c0ef09d57a80068a11edc74c3568e5ead5cc15a")
|
||||
("dockerfile-mode" . "b63a3d12b7dea0cb9efc7f78d7ad5672ceab2a3f")
|
||||
("ebib" . "0e243a78f435038dda31953c5b48cbddf2a89e27")
|
||||
("el-get" . "91352ca0f895d099f608644c8e9ad8e844b5c520")
|
||||
("el-get" . "bf3dba444dcd240b8cb358a0850c8c5a92606134")
|
||||
("elpy" . "1746e7009000b7635c0ea6f1559018143aa61642")
|
||||
("emacs-async" . "c78bab7506a70a735d2c3deab13fa87bf44a83d3")
|
||||
("emacs-buttercup" . "ceedad5efa797e860dbb356bc2c3028a4e0321ec")
|
||||
("emacs-calfw" . "03abce97620a4a7f7ec5f911e669da9031ab9088")
|
||||
("emacs-dashboard" . "a4eb09778f7b685b6ff652212bf1fa2e6e1305d7")
|
||||
("emacs-dashboard" . "34d1f97200055e6b521c131270d8322efc6c52be")
|
||||
("emacs-format-all-the-code" . "828280eaf3b46112e17746a7d03235570a633425")
|
||||
("emacs-htmlize" . "dd27bc3f26efd728f2b1f01f9e4ac4f61f2ffbf9")
|
||||
("emacs-language-id" . "5325af36d9cd726de47a698ac159fce59f3fd6d9")
|
||||
("emacs-refactor" . "cac1b52932926f56d7f6d2923732d20bbd20670d")
|
||||
("emacs-web-server" . "22ce66ea43e0eadb9ec1d691a35d9695fc29cee6")
|
||||
("emacs-which-key" . "129f4ebfc74f207ac82978f6d90d8b4bb1a55cf9")
|
||||
("emacsmirror-mirror" . "378111b2b7846064679a063f4eec48ef6de39ce9")
|
||||
("emacs-which-key" . "1ab1d0cc88843c9a614ed3226c5a1070e32e4823")
|
||||
("emacsmirror-mirror" . "2e1ceba3c8036637832e99414d9012359911f5e4")
|
||||
("epl" . "78ab7a85c08222cd15582a298a364774e3282ce6")
|
||||
("evil" . "5a9cfbc443219c4063b17853b7828ec0a00d2736")
|
||||
("evil" . "157af04d2cf466e301e82b0e667c5e7203fd96a2")
|
||||
("evil-ReplaceWithRegister" . "91cc7bf21a94703c441cc9212214075b226b7f67")
|
||||
("evil-collection" . "11cfad9b3c01feb7848f13d5c3f5cc1787ab6eb6")
|
||||
("evil-collection" . "98d28bc67909225a4746c557449c9da816f5d0f5")
|
||||
("evil-commentary" . "2dab6ac34d1617971768ad219d73af48f7473fec")
|
||||
("evil-org-mode" . "0d10ff7bb9a3a93d25cd91018b17f0a052b335f3")
|
||||
("evil-surround" . "c9e1449bf3f740b5e9b99e7820df4eca7fc7cf02")
|
||||
("f.el" . "e0dc429f9c20322c7af735a828fe2404bb416715")
|
||||
("f.el" . "bf586b80a5298df68a094f70bc1a1bd6f8e948df")
|
||||
("fill-column-indicator" . "c35f9de072c241699b57bcb46da84bed5af29cfe")
|
||||
("flycheck" . "66a973afca1d03b8284baaa7590eb2b8615a1e6a")
|
||||
("flycheck-clang-analyzer" . "646d9f3a80046ab231a07526778695d5decad92d")
|
||||
("flycheck-package" . "615c1ed8c6fb7c73abec6aaa73d3fef498d231bc")
|
||||
("flyspell-correct" . "e8027a412262bc04056a5b5440efdb7f370c3320")
|
||||
("gnu-elpa-mirror" . "a388b8aa566f391705cc43faa7678d7fffc95330")
|
||||
("flyspell-correct" . "7d7b6b01188bd28e20a13736ac9f36c3367bd16e")
|
||||
("gnu-elpa-mirror" . "808923d95777d378ca340b8020dd571e6a62460a")
|
||||
("goto-chg" . "278cd3e6d5107693aa2bb33189ca503f22f227d0")
|
||||
("graphviz-dot-mode" . "6e96a89762760935a7dff6b18393396f6498f976")
|
||||
("haskell-mode" . "fe3a8046aa1e1767ddc11a74e3d45bd9c614e655")
|
||||
("haskell-mode" . "5a9f8072c7b9168f0a8409adf9d62a3e4ad4ea3d")
|
||||
("helm-bibtex" . "ce8c17690ddad73d01531084b282f221f8eb6669")
|
||||
("ht.el" . "c4c1be487d6ecb353d07881526db05d7fc90ea87")
|
||||
("hydra" . "9e9e00cb240ea1903ffd36a54956b3902c379d29")
|
||||
|
@ -75,27 +75,28 @@
|
|||
("lispy" . "df1b7e614fb0f73646755343e8892ddda310f427")
|
||||
("list-utils" . "ca9654cd1418e874c876c6b3b7d4cd8339bfde77")
|
||||
("lua-mode" . "5a9bee8d5fc978dc64fcb677167417010321ba65")
|
||||
("magit" . "5a7519fd3d56522b1c6a1601a12ae0f4717c26a7")
|
||||
("magit" . "9b48dd7e3618ac3736f66ef964ae5e1fedd54f98")
|
||||
("map" . "9f46b9c966505874d68d9036827a4f63b55ab846")
|
||||
("markdown-mode" . "4477f381de0068a04b55e198c32614793f67b38a")
|
||||
("markdown-mode" . "1f709778ac7990f4a07fdf11fe37bc6541810b29")
|
||||
("math-symbol-lists" . "590d9f09f8ad9aab747b97f077396a2035dcf50f")
|
||||
("melpa" . "1c858ee39e50876efc483881e6348597664adb7a")
|
||||
("no-littering" . "fed46eb7060aca624bfe1a18f13b73f94e70f013")
|
||||
("melpa" . "5be08102d4de84c35b18cd1e3321fe8b6836ff56")
|
||||
("no-littering" . "a5aa3faada054f96b70b32ba9d9447f7a4cf403c")
|
||||
("org-bullets" . "767f55feb58b840a5a04eabfc3fbbf0d257c4792")
|
||||
("org-ml" . "3974435bbf72722801f7ed78855381d77a773162")
|
||||
("org-ref" . "0d2355d1eb4dcac1095a03d885788a12fe566610")
|
||||
("org-ml" . "f191ebfee6dcf6a05b5d1db43cf75f4a20faa8b4")
|
||||
("org-ref" . "cbe9e870a5f488cdfc5e6a3b5478845ea8acdcde")
|
||||
("org-sql" . "71b6e01ff94be4c68cfeb17a34518bf1f118cf95")
|
||||
("org-super-agenda" . "3108bc3f725818f0e868520d2c243abe9acbef4e")
|
||||
("origami.el" . "e558710a975e8511b9386edc81cd6bdd0a5bda74")
|
||||
("outline-magic" . "2a5f07417b696cf7541d435c43bafcc64817636b")
|
||||
("package-lint" . "80a9d9815ab2919c992ad29ae4846443dec43a35")
|
||||
("ox-pandoc" . "0a35d0fbfa56bdd9ec5ba5bac2fe002b61c05c52")
|
||||
("package-lint" . "622a5a6e853e5a4c7f2b4c53e2ac0edde354b07c")
|
||||
("paredit" . "8330a41e8188fe18d3fa805bb9aa529f015318e8")
|
||||
("parsebib" . "dd4c5540fa6c2cd990cba324741d7abbc8ed2f23")
|
||||
("parseclj" . "1ce54fa2eb7a5d99d34c07d271e18eaabd0489da")
|
||||
("parseedn" . "a67204eeaa32ca8f11f6aeecc2a88349f196add6")
|
||||
("password-store" . "c4d8a1d815e79ddd89a85d3e36a41d29f0475771")
|
||||
("pcre2el" . "0b5b2a2c173aab3fd14aac6cf5e90ad3bf58fa7d")
|
||||
("pdf-tools" . "fedd930a09a497c03df3ce5204ccbd80da724662")
|
||||
("pdf-tools" . "f9ccdf99e560bae70d3a13325cec9dc0e3cc45b0")
|
||||
("php-mode" . "4503672471b8fdaaea6c454344817a119c87fcc6")
|
||||
("pkg-info" . "76ba7415480687d05a4353b27fea2ae02b8d9d61")
|
||||
("pkgbuild-mode" . "8faee70e4640bd6ec1857651ec64e139e4dc2833")
|
||||
|
@ -103,9 +104,9 @@
|
|||
("poly-markdown" . "d4ca396ec4a7d674ef0d671a6896f929ce5b504c")
|
||||
("poly-noweb" . "3b0cd36ca9a707e8a09337a3468fa85d81fc461c")
|
||||
("polymode" . "2094c92403fe395dfb2b8b2521da1012a966e9ab")
|
||||
("popup-el" . "114d646f0f4dd49de19dfedd78630018f71470e5")
|
||||
("popup-el" . "976bd8e06100df5a266377d0e5f63b104ba93119")
|
||||
("powerline" . "566c77844f053cb39fa7acdfbc143a855450f0b5")
|
||||
("projectile" . "a4f86f981c84a546530d5904253fa266431ef806")
|
||||
("projectile" . "e60883ff370c1545499b97cf56479de1a58c5b3b")
|
||||
("pyenv-mode" . "b818901b8eac0e260ced66a6a5acabdbf6f5ba99")
|
||||
("pythonic" . "fe75bc17baae314bf8f5e0b12aad3fccfc6c5397")
|
||||
("pyvenv" . "31ea715f2164dd611e7fc77b26390ef3ca93509b")
|
||||
|
@ -121,14 +122,14 @@
|
|||
("spaceline" . "9a81afa52738544ad5e8b71308a37422ca7e25ba")
|
||||
("spacemacs-theme" . "bd376f705d6eb7afd9a1dfa0c1bd407e869d1e9f")
|
||||
("spinner" . "34905eae12a236753fa88abc831eff1e41e8576e")
|
||||
("straight.el" . "af5437f2afd00936c883124d6d3098721c2d306c")
|
||||
("straight.el" . "4517e118ee43f849f708025dbb2cf4f281793121")
|
||||
("string-inflection" . "fd7926ac17293e9124b31f706a4e8f38f6a9b855")
|
||||
("sudo-edit" . "23b78a39053088839f281bc0c3134203d7e04e50")
|
||||
("swiper" . "8bf8027e4bd8c093bddb76a813952d2a0dcbf21d")
|
||||
("swiper" . "f8d80a4055514f92d94f128f5fcb1cda79e5cd22")
|
||||
("systemd-mode" . "b6ae63a236605b1c5e1069f7d3afe06ae32a7bae")
|
||||
("tablist" . "faab7a035ef2258cc4ea2182f67e3aedab7e2af9")
|
||||
("toc-org" . "bf2e4b358efbd860ecafe6e74776de0885d9d100")
|
||||
("transient" . "a0c69e5c712511a35d0ab53a5634420e9705149e")
|
||||
("transient" . "2e4426fe8161893382f09b3f4635e152ee02488e")
|
||||
("ts.el" . "3fee71ceefac71ba55eb34829d7e94bb3df37cee")
|
||||
("use-package" . "a7422fb8ab1baee19adb2717b5b47b9c3812a84c")
|
||||
("with-editor" . "4ab8c6148bb2698ff793d4a8acdbd8d0d642e133")
|
||||
|
|
Loading…
Reference in New Issue