branch: elpa/gnosis commit 326f6445ba84abcb54c665c63443d0cb0d92733d Author: Thanos Apollo <pub...@thanosapollo.org> Commit: Thanos Apollo <pub...@thanosapollo.org>
[fix] algorithm: allow last-interval to be 0 for failed reviews. --- gnosis-algorithm.el | 4 ++-- gnosis.el | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/gnosis-algorithm.el b/gnosis-algorithm.el index 66dd558683..dfc45a319d 100644 --- a/gnosis-algorithm.el +++ b/gnosis-algorithm.el @@ -194,8 +194,8 @@ LETHE: Upon having C-FAILS >= lethe, set next interval to 0." (cl-assert (and (floatp amnesia) (<= amnesia 1)) nil "Amnesia must be a float <=1") (cl-assert (and (<= amnesia 1) (> amnesia 0)) nil "Value of amnesia must be a float <= 1") (cl-assert (and (integerp lethe) (>= lethe 1)) nil "Value of lethe must be an integer >= 1") - ;; This should only occur in testing env or when the user has made breaking changes. - (let* ((last-interval (if (<= last-interval 0) 1 last-interval)) ;; If last-interval is 0, use 1 instead. + ;; If last-interval is 0, use 1 instead, only for successful reviews. + (let* ((last-interval (if (and (<= last-interval 0) success) 1 last-interval)) (amnesia (- 1 amnesia)) ;; inverse amnesia (interval (cond ((and (< successful-reviews (length proto)) success) diff --git a/gnosis.el b/gnosis.el index a176efeea2..e2468c2032 100644 --- a/gnosis.el +++ b/gnosis.el @@ -1062,7 +1062,7 @@ Optionally, provide a list for due NOTE-IDS." (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))) - (max (gnosis-algorithm-date-diff last-rev rev-date) 1))) + (gnosis-algorithm-date-diff last-rev rev-date))) (defun gnosis-review-algorithm (id success) "Return next review date & gnosis for note with value of id ID. @@ -2082,8 +2082,6 @@ Optionally, use CUSTOM-DECK and CUSTOM-VALUES." (defun gnosis-get-note-amnesia (id &optional custom-deck custom-tags custom-values ) "Return amnesia value for note ID. -Note amnesia should be hte MINIMUM value of deck's & tags' amnesia. - CUSTOM-DECK: Specify custom deck. CUSTOM-TAGS: Specify custom tags for note id. CUSTOM-VALUES: Specify custom values."