From 689398a7711b548cdec2f31e3ac4ae5174d992bc Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Tue, 9 Jan 2024 10:38:01 +0200 Subject: Rewrite gnosis-review-is-due-p --- gnosis.el | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'gnosis.el') diff --git a/gnosis.el b/gnosis.el index 966609f..9c8ea40 100644 --- a/gnosis.el +++ b/gnosis.el @@ -749,6 +749,14 @@ Returns a list of unique tags." ;; Review ;;;;;;;;;; +(defun gnosis-review-is-due-p (note-id) + "Check if note with value of NOTE-ID for id is due for review. + +Check if it's suspended, and if it's due today." + (if (and (not (gnosis-suspended-p note-id)) + (gnosis-review-is-due-today-p note-id)) + t + nil)) (defun gnosis-review--algorithm (id success) "Return next review date & ef for note with value of id ID. @@ -761,11 +769,6 @@ Returns a list of the form ((yyyy mm dd) ef)." (gnosis-get 'n 'review-log `(= id ,id)) ef success ff c-success))) -(defun gnosis-review-is-due-p (note-id) - "Return t if unsuspended note with NOTE-ID is due today." - (emacsql gnosis-db `[:select [id] :from review-log :where (and (<= next-rev ',(gnosis-algorithm-date)) - (= suspend 0) - (= id ,note-id))])) (defun gnosis-review-get-due-notes () "Return a list due notes id for current date. -- cgit v1.2.3