summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-09 10:38:01 +0200
committerThanos Apollo <[email protected]>2024-01-09 10:38:01 +0200
commit689398a7711b548cdec2f31e3ac4ae5174d992bc (patch)
treed49200b4b678edb3bd95ca947094b6fe1e940384 /gnosis.el
parentbdf07ba3adf599ac5027fd741923de7dfc41c851 (diff)
Rewrite gnosis-review-is-due-p
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el13
1 files changed, 8 insertions, 5 deletions
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.