ADD agenda view for tasks grouped by goal

This commit is contained in:
Nathan Dwarshuis 2022-02-20 10:47:00 -05:00
parent 84977f9947
commit b5a19fcff3
1 changed files with 16 additions and 1 deletions

View File

@ -1758,7 +1758,7 @@ FUTURE-LIMIT in a list."
(let ((parents (org-x-dag-id->parents id))) (let ((parents (org-x-dag-id->parents id)))
(-if-let (goal-ids (--filter (member (org-x-dag-id->file it) goal-files) parents)) (-if-let (goal-ids (--filter (member (org-x-dag-id->file it) goal-files) parents))
goal-ids goal-ids
(-map #'get parents))))) (-mapcat #'get parents)))))
(get id)))) (get id))))
(defun org-x-dag-scan-tasks-with-goals () (defun org-x-dag-scan-tasks-with-goals ()
@ -2302,5 +2302,20 @@ FUTURE-LIMIT in a list."
(lambda (line) (lambda (line)
(get-text-property 1 'x-day-of-week line))))))))) (get-text-property 1 'x-day-of-week line)))))))))
(defun org-x-dag-agenda-tasks-by-goal ()
(interactive)
(let ((match ''org-x-dag-scan-tasks-with-goals)
(files (org-x-get-action-files)))
(nd/org-agenda-call "Tasks by Goal" nil #'org-x-dag-show-nodes match files
`((org-agenda-todo-ignore-with-date t)
(org-agenda-sorting-strategy '(user-defined-up category-keep))
(org-super-agenda-groups
'((:auto-map
(lambda (line)
(-if-let (i (get-text-property 1 'x-goal-id line))
;; TODO this is the literal ID, I want the headline text
(substring-no-properties i)
"Unlinked")))))))))
(provide 'org-x-dag) (provide 'org-x-dag)
;;; org-x-dag.el ends here ;;; org-x-dag.el ends here