From 5b7bf448f26374e22d88e00bcd37ce66e4b3e48b Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 3 Apr 2022 17:22:09 -0400 Subject: [PATCH] ENH update project/goal view --- local/lib/org-x/org-x-dag.el | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/local/lib/org-x/org-x-dag.el b/local/lib/org-x/org-x-dag.el index 56a159a..f552364 100644 --- a/local/lib/org-x/org-x-dag.el +++ b/local/lib/org-x/org-x-dag.el @@ -3184,17 +3184,6 @@ except it ignores inactive timestamps." (--map (org-add-props (copy-seq item) nil 'x-goal-id it) ids) (list (org-add-props item nil 'x-goal-id nil)))) -(defun org-x-dag-scan-projects-with-goals () - (cl-flet - ((split-parent-goals - (s) - (let ((id (get-text-property 1 'x-id s))) - (-if-let (goal-ids (org-x-dag-id->linked-parents id)) - (org-x-dag--item-add-goal-ids s goal-ids))))) - (->> (org-x-dag-scan-projects) - (--filter (org-x-dag-id->is-toplevel-p (get-text-property 1 'x-id it))) - (-mapcat #'split-parent-goals)))) - (defun org-x-dag-scan-iterators () (org-x-dag-with-action-ids (either-from-right (org-x-dag-id->bs it) nil @@ -3262,6 +3251,21 @@ except it ignores inactive timestamps." 'x-status :active) (org-x-dag--item-add-goal-ids goal-ids))))))))) +(defun org-x-dag-scan-projects-with-goals () + (org-x-dag-with-action-ids + (either-from-right* (org-x-dag-id->bs it) nil + (lambda (bs) + (pcase bs + (`(:sp-proj . ,s) + (unless (eq (car s) :proj-complete) + (let ((goal-ids (-when-let (ns (org-x-dag-id->ns it)) + (either-from-right ns nil + (unless (plist-get it :survivalp) + (plist-get it :committed))))) + (tags (org-x-dag-id->tags nil it))) + (-> (org-x-dag-format-tag-node tags it) + (org-x-dag--item-add-goal-ids goal-ids)))))))))) + (defun org-x-dag-scan-survival-tasks () (cl-flet ((format-key