From a6ef9a3bba8aadfa700160c6ab9f53d95eb10f9f Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Mon, 19 Feb 2024 18:07:49 -0500 Subject: [PATCH] ENH remove done entries from link menu --- local/lib/org-x/org-x-dag.el | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/local/lib/org-x/org-x-dag.el b/local/lib/org-x/org-x-dag.el index 41bc2e9..0788917 100644 --- a/local/lib/org-x/org-x-dag.el +++ b/local/lib/org-x/org-x-dag.el @@ -4399,23 +4399,30 @@ FUTURE-LIMIT in a list." (either :right it))))) ;; child id functions + (remove-done + (ids) + (--remove (member (org-x-dag-id->todo it) org-done-keywords) ids)) + (action-qtp-getter () (->> (org-x-dag->action-ids) ;; TODO could also remove DONE/CANC and things ;; underneath these (--remove (org-x-dag-id->ns-key :survivalp it)) + (remove-done) (append (org-x-dag->current-qtp-ids)))) (svg-action-getter () (->> (org-x-dag->action-ids) ;; TODO could also remove DONE/CANC and things ;; underneath these + (remove-done) (--remove (and (org-x-dag-id->ns-key :committed it) (not (org-x-dag-id->ns-key :survivalp it)))))) (epg-action-qtp-getter () - `(,@(org-x-dag->epg-ids) ,@(action-qtp-getter))) + (->> `(,@(org-x-dag->epg-ids) ,@(action-qtp-getter)) + (remove-done))) ;; format functions (dlp-formatter @@ -4553,16 +4560,27 @@ FUTURE-LIMIT in a list." (either :right)) (parse-hl))) + (remove-done + (ids) + (--remove (member (org-x-dag-id->todo it) org-done-keywords) ids)) + ;; parent id getters (tlg-getter () - (append (org-x-dag->epg-ids) (org-x-dag->ltg-ids))) + (->> (append (org-x-dag->epg-ids) (org-x-dag->ltg-ids)) + (remove-done))) (goal-getter () - (append (org-x-dag->svg-ids) (tlg-getter))) + (->> (append (org-x-dag->svg-ids) (tlg-getter)) + (remove-done))) (dlp-getter () - (append (org-x-dag->current-wkp-ids) (org-x-dag->action-ids))) + (->> (append (org-x-dag->current-wkp-ids) (org-x-dag->action-ids)) + (remove-done))) + (weekly-getter + () + (->> (org-x-dag->current-qtp-ids) + (remove-done))) ;; formatters (goal-formatter @@ -4592,7 +4610,7 @@ FUTURE-LIMIT in a list." ((equal f (org-x-dag->planning-file :weekly)) (org-x-dag--link-child-to-parent #'parse-hl - #'org-x-dag->current-qtp-ids + #'weekly-getter #'org-x-dag-id->title)) ((equal f (org-x-dag->planning-file :daily)) (org-x-dag--link-child-to-parent