summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-05-10 14:04:04 +0300
committerThanos Apollo <[email protected]>2024-05-10 14:04:04 +0300
commit28a1c9f1680320cf22356f71db113b0d7ebc4623 (patch)
tree76ecd39fa1f28dbc01daf67234b87de288803a23 /gnosis.el
parentb919351d70d70e3d5c3dc7a16ccaf4e703f16b7f (diff)
Add gnosis-review-last-interval
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el17
1 files changed, 12 insertions, 5 deletions
diff --git a/gnosis.el b/gnosis.el
index a951664..b32fced 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -1101,6 +1101,18 @@ well."
due-notes)
:test #'equal)))
+(defun gnosis-review--get-offset (id)
+ "Return offset for note with value of id ID."
+ (let ((last-rev (gnosis-get 'last-rev 'review-log `(= id ,id))))
+ (gnosis-algorithm-date-diff last-rev)))
+
+(defun gnosis-review-last-interval (id)
+ "Return last review interval for note ID."
+ (let* ((where-id-clause `(= id ,id))
+ (last-rev (gnosis-get 'last-rev 'review-log where-id-clause))
+ (rev-date (gnosis-get 'next-rev 'review-log where-id-clause)))
+ (gnosis-algorithm-date-diff last-rev rev-date)))
+
(defun gnosis-review-algorithm (id success)
"Return next review date & ef for note with value of id ID.
@@ -1129,11 +1141,6 @@ Returns a list of the form ((yyyy mm dd) (ef-increase ef-decrease ef-total))."
:c-successes c-success
:c-failures c-fails))))
-(defun gnosis-review--get-offset (id)
- "Return offset for note with value of id ID."
- (let ((last-rev (gnosis-get 'last-rev 'review-log `(= id ,id))))
- (gnosis-algorithm-date-diff last-rev)))
-
(defun gnosis-review--update (id success)
"Update review-log for note with value of id ID.