From d34c22f1781676018d575e6274e7975c2d986e94 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Sat, 20 Jul 2024 06:51:48 +0300 Subject: [Refactor] gnosis-review-get-due-notes: Adjust for new notes limit. * Use gnosis-new-notes-limit to calculate new notes for review. --- gnosis.el | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gnosis.el b/gnosis.el index dfbf265..e3577bc 100644 --- a/gnosis.el +++ b/gnosis.el @@ -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.") -- cgit v1.2.3