From 28256511b368f53344afcfcf7e2a77cdbef1f608 Mon Sep 17 00:00:00 2001 From: Puppet Date: Thu, 29 Sep 2022 17:04:25 -0500 Subject: [PATCH] Puppet helped me find a bug! WAIT behavior is now more consistent --- lisp/org-config/my-org-agenda-commands.el | 2 +- lisp/org-project/opr-tasks.el | 2 +- tests/files/meta-stuck-base.org | 4 ++++ tests/files/wait-active.org | 3 +++ tests/files/wait-stuck.org | 5 +++++ tests/my-org-tests.el | 6 ++++++ 6 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 tests/files/wait-active.org create mode 100644 tests/files/wait-stuck.org diff --git a/lisp/org-config/my-org-agenda-commands.el b/lisp/org-config/my-org-agenda-commands.el index b307140..53d8f43 100644 --- a/lisp/org-config/my-org-agenda-commands.el +++ b/lisp/org-config/my-org-agenda-commands.el @@ -258,7 +258,7 @@ (setq org-agenda-custom-commands `(("p" . "\tprod") - ,@(agenda-suite "all" "pa" "time") + ,@(agenda-suite "all" "pa" "prod") ,@(agenda-suite "school" "ps" "time") ,@(agenda-suite "family" "pf" "time") ,@(agenda-suite "dev" "d" "dev") diff --git a/lisp/org-project/opr-tasks.el b/lisp/org-project/opr-tasks.el index 8f9af86..8e54e8b 100644 --- a/lisp/org-project/opr-tasks.el +++ b/lisp/org-project/opr-tasks.el @@ -63,7 +63,7 @@ ("WAIT" (if (when-let (d (org-entry-get (point) "SCHEDULED")) (org-time> d (org-matcher-time ""))) 'wait-active ;; BENSON_UPDATE_THIS: Change this to active? - 'wait)) + 'stuck)) (_ (when (or (member state opr/strict-tasks) (and (member state opr/ambiguous) (eq 'task diff --git a/tests/files/meta-stuck-base.org b/tests/files/meta-stuck-base.org index 8a35ba3..1294be2 100644 --- a/tests/files/meta-stuck-base.org +++ b/tests/files/meta-stuck-base.org @@ -13,3 +13,7 @@ * META should be stuck even if there are deadlined dones ** DONE Deadlined done task DEADLINE: <2021-06-21 Mon> +* META should be stuck if there are past-due waiting tasks +** WAIT for this to happen +SCHEDULED: <1970-01-01 Thu> +- State "WAIT" from [2022-09-29 Thu 16:53] diff --git a/tests/files/wait-active.org b/tests/files/wait-active.org new file mode 100644 index 0000000..647c60a --- /dev/null +++ b/tests/files/wait-active.org @@ -0,0 +1,3 @@ + +* WAIT Waiting tasks, when they are scheduled in the future, are wait-active +SCHEDULED: <2037-01-01 Thu> diff --git a/tests/files/wait-stuck.org b/tests/files/wait-stuck.org new file mode 100644 index 0000000..a40d4ae --- /dev/null +++ b/tests/files/wait-stuck.org @@ -0,0 +1,5 @@ + +* WAIT tasks are stuck if there is no schedule + +* WAIT tasks are stuck if their scheduled date has passed +SCHEDULED: <1970-01-01 Thu> diff --git a/tests/my-org-tests.el b/tests/my-org-tests.el index 4c85d3a..3313f9a 100644 --- a/tests/my-org-tests.el +++ b/tests/my-org-tests.el @@ -67,6 +67,12 @@ (should (null (my/org-agenda-skip-unless-prod-tag))) (should (not (null (my/org-agenda-skip-unless-dev-tag))))) +(org-test/parents-should "wait-stuck.org" + (should (eq 'stuck (opr/type-of-task)))) + +(org-test/parents-should "wait-active.org" + (should (eq 'wait-active (opr/type-of-task)))) + (ert-run-tests-interactively t) ;; (progn (setq org-disabled-tests nil) (mapcar (lambda (sym) (put sym 'ert--test nil)) (apropos-internal "" #'ert-test-boundp)))