From 74fc4723cd1650384228a346ae1cb7c8a66ae21f Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Sun, 22 May 2022 17:03:49 -0400 Subject: [PATCH] FIX don't present a weekly plan if no span exists --- local/lib/org-x/org-x-dag.el | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/local/lib/org-x/org-x-dag.el b/local/lib/org-x/org-x-dag.el index 2864c8f..ae88a99 100644 --- a/local/lib/org-x/org-x-dag.el +++ b/local/lib/org-x/org-x-dag.el @@ -2559,13 +2559,13 @@ Return value is a list like (BUFFER NON-BUFFER)." (org-x-dag-date->qtp-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 ((in-span (id) - (-when-let (bs (either-from-right (org-x-dag-id->bs id) id)) - (-let (((_ _ (&plist :date d :offset o)) bs)) - (interval-contains-p (+ d o) span))))) + (pcase (either-from-right (org-x-dag-id->bs id) id) + (`(:weekly :leaf :active ,abs) + (interval-contains-p abs span))))) (->> (org-x-dag->wkp-ids) (-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 ;; anyways because they assume the week start will never change) (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 (pcase (either-from-right (org-x-dag-id->bs it) nil) (`(:weekly :leaf :active ,abs)