From c0312a1f283c7fed4dae3bc236a53bc5dee7c5c8 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Wed, 20 Apr 2022 20:41:48 -0400 Subject: [PATCH] ENH make status view show network status in sane way --- local/lib/org-x/org-x-dag.el | 67 +++++++++++++++++++++++++++++++----- 1 file changed, 59 insertions(+), 8 deletions(-) diff --git a/local/lib/org-x/org-x-dag.el b/local/lib/org-x/org-x-dag.el index 0c2586e..13b008e 100644 --- a/local/lib/org-x/org-x-dag.el +++ b/local/lib/org-x/org-x-dag.el @@ -3832,22 +3832,57 @@ FUTURE-LIMIT in a list." (-some->> (plist-get ns-data key) (--map (funcall fun it)) (org-x-dag--indent-lines 2) - (cons (format "%s:" header))))) + (cons (format "%s:" header)))) + (append-groups + (&rest groups) + (or (->> (-non-nil groups) + (-interpose '("")) + (-flatten-n 1)) + '("none")))) (let ((group (org-x-dag-id->group id))) (pcase group (:action - (append + (append-groups (format-group "Planned" :planned #'org-x-dag-id->title) (format-group "Committed Goals" :committed #'org-x-dag--format-title-with-group))) - (:lifetime) - (:endpoint) - (:survival) + (:lifetime + (append-groups + (format-group "Planned" + :planned + #'org-x-dag-id->title) + (format-group "Fulfilled" + :committed + #'org-x-dag--format-title-with-group))) + (:endpoint + (append-groups + (format-group "Planned" + :planned + #'org-x-dag-id->title) + (format-group "Committed" + :committed + (lambda (id) + (org-x-dag-id->path nil id))) + (format-group "Fulfilled" + :fulfilled + (lambda (id) + (org-x-dag-id->path t id))))) + (:survival + (append-groups + ;; TODO not sure if this works + (format-group "Planned" + :planned + (lambda (id) + (org-x-dag-id->path t id))) + (format-group "Fulfilled" + :fulfilled + (lambda (id) + (org-x-dag-id->path t id))))) (:quarterly - (append + (append-groups (format-group "Scheduled actions" :scheduled-actions (lambda (id) @@ -3858,8 +3893,24 @@ FUTURE-LIMIT in a list." (format-group "Committed Goals" :committed #'org-x-dag--format-title-with-group))) - (:weekly) - (:daily))))) + (:weekly + (append-groups + (format-group "Planned" + :planned + (lambda (id) + (org-x-dag-id->path t id))) + (format-group "Committed" + :committed + #'org-x-dag-id->title))) + (:daily + (append-groups + (format-group "Planned" + :planned + (lambda (id) + (org-x-dag-id->path t id))) + (format-group "Committed" + :committed + #'org-x-dag-id->title))))))) (defun org-x-dag-show-status () (interactive)