diff options
author | Thanos Apollo <[email protected]> | 2024-07-20 06:51:48 +0300 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2024-07-20 06:51:48 +0300 |
commit | d34c22f1781676018d575e6274e7975c2d986e94 (patch) | |
tree | 1ebc1b837ee834f33f65183d7c165fa7f1905ed1 /gnosis.el | |
parent | 6d305eb08092d155d3e00a61122732586e3030a6 (diff) |
[Refactor] gnosis-review-get-due-notes: Adjust for new notes limit.
* Use gnosis-new-notes-limit to calculate new notes for review.
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 12 |
1 files changed, 8 insertions, 4 deletions
@@ -1375,10 +1375,14 @@ well." (defun gnosis-review-get-due-notes () "Return a list due notes id for current date." - (let ((notes (gnosis-select 'id 'notes '1=1 t))) - (cl-loop for note in notes - when (gnosis-review-is-due-p note) - collect note))) + (let* ((old-notes (cl-loop for note in (gnosis-select 'id 'review-log '(> n 0) t) + when (gnosis-review-is-due-p note) + collect note)) + (new-notes (cl-loop for note in (gnosis-select 'id 'review-log '(= n 0) t) + when (gnosis-review-is-due-p note) + collect note))) + (append (cl-subseq new-notes 0 gnosis-new-notes-limit) old-notes))) + (defun gnosis-get-new-notes (notes) "Get new notes from NOTES." (cl-assert (listp notes) nil "Notes must be a list.") |