ENH filter goals based on goal links

This commit is contained in:
Nathan Dwarshuis 2021-12-25 14:23:11 -05:00
parent 042c035962
commit b5ca95a598
1 changed files with 10 additions and 3 deletions

View File

@ -3233,20 +3233,27 @@ In the order of display
(:name "Calendar" :order 1 :time-grid t) (:name "Calendar" :order 1 :time-grid t)
(:discard (:anything t))))))) (:discard (:anything t)))))))
(defvar nd/org-agenda-goal-task-ids nil)
(defun nd/org-agenda-goals () (defun nd/org-agenda-goals ()
"Show the goals agenda view." "Show the goals agenda view."
(interactive) (interactive)
;; TODO this will only fire when the agenda view is first made, redo doesn't
;; call it again
(setq nd/org-agenda-goal-task-ids (org-x-get-goal-ids))
(nd/org-agenda-call "Goals" 'todo org-x-kw-todo (nd/org-agenda-call "Goals" 'todo org-x-kw-todo
'((org-agenda-overriding-header "Goals") `((org-agenda-overriding-header "Goals")
(org-agenda-files (org-agenda-files
'("~/Org/reference/goals")) '("~/Org/reference/goals"))
(org-agenda-sorting-strategy (org-agenda-sorting-strategy
'(time-up scheduled-down)) '(time-up scheduled-down))
(org-super-agenda-groups (org-super-agenda-groups
'((:auto-category)))))) `(,(nd/org-def-super-agenda-pred "Childless"
(not (member (org-entry-get nil "ID") nd/org-agenda-goal-task-ids)))
(:auto-category))))))
(defun nd/org-agenda-daily () (defun nd/org-agenda-daily ()
"Show the daily agenda view" "Show the daily agenda view."
(interactive) (interactive)
(nd/org-agenda-call "Daily" 'agenda "" (nd/org-agenda-call "Daily" 'agenda ""
'((org-agenda-skip-function #'org-x-calendar-skip-function) '((org-agenda-skip-function #'org-x-calendar-skip-function)