FIX don't present a weekly plan if no span exists

This commit is contained in:
Nathan Dwarshuis 2022-05-22 17:03:49 -04:00
parent 843013884b
commit 74fc4723cd
1 changed files with 5 additions and 5 deletions

View File

@ -2559,13 +2559,13 @@ Return value is a list like (BUFFER NON-BUFFER)."
(org-x-dag-date->qtp-ids))) (org-x-dag-date->qtp-ids)))
(defun org-x-dag->current-wkp-ids () (defun org-x-dag->current-wkp-ids ()
(let ((span (org-x-dag->weekly-span))) (-when-let (span (org-x-dag->weekly-span))
(cl-flet (cl-flet
((in-span ((in-span
(id) (id)
(-when-let (bs (either-from-right (org-x-dag-id->bs id) id)) (pcase (either-from-right (org-x-dag-id->bs id) id)
(-let (((_ _ (&plist :date d :offset o)) bs)) (`(:weekly :leaf :active ,abs)
(interval-contains-p (+ d o) span))))) (interval-contains-p abs span)))))
(->> (org-x-dag->wkp-ids) (->> (org-x-dag->wkp-ids)
(-filter #'in-span))))) (-filter #'in-span)))))
@ -3123,7 +3123,7 @@ FUTURE-LIMIT in a list."
;; and not doing these convoluted date checks (which won't work in all cases ;; and not doing these convoluted date checks (which won't work in all cases
;; anyways because they assume the week start will never change) ;; anyways because they assume the week start will never change)
(defun org-x-dag-itemize-wkp (files) (defun org-x-dag-itemize-wkp (files)
(let ((span (org-x-dag->weekly-span))) (-when-let (span (org-x-dag->weekly-span))
(org-x-dag-with-ids files (org-x-dag-with-ids files
(pcase (either-from-right (org-x-dag-id->bs it) nil) (pcase (either-from-right (org-x-dag-id->bs it) nil)
(`(:weekly :leaf :active ,abs) (`(:weekly :leaf :active ,abs)