From 015f2b692f7b986e3cc287f38f44a7806e40faa1 Mon Sep 17 00:00:00 2001 From: Thanos Apollo Date: Wed, 31 Jul 2024 10:29:08 +0300 Subject: New custom: review-new-first * When non-nil review new notes first during a gnosis review session. --- gnosis.el | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/gnosis.el b/gnosis.el index ac4c0f5..a5a3e46 100644 --- a/gnosis.el +++ b/gnosis.el @@ -201,6 +201,13 @@ Seperate the question/stem from options." (integer :tag "Number")) :group 'gnosis) +(defcustom gnosis-review-new-first t + "Review new notes first. + +When nil, review new notes last." + :type 'bolean + :group 'gnosis) + (defvar gnosis-due-notes-total nil "Total due notes.") @@ -795,9 +802,7 @@ SUSPEND: Integer value of 1 or 0, where 1 suspends the card IMAGE: Image to display during review. SECOND-IMAGE: Image to display after user-input. -NOTE: If a gnosis--insert-into fails, the whole transaction will be - (or at least it should). Else there will be an error for foreign key - constraint." +If a gnosis--insert-into fails, the whole transaction will be." (let* ((deck-id (gnosis--get-deck-id deck)) (initial-interval (gnosis-get-deck-initial-interval deck-id)) (note-id (gnosis-generate-id))) @@ -1428,7 +1433,9 @@ well." t) when (gnosis-review-is-due-today-p note) collect note))) - (append (cl-subseq new-notes 0 gnosis-new-notes-limit) old-notes))) + (if gnosis-review-new-first + (append (cl-subseq new-notes 0 gnosis-new-notes-limit) old-notes) + (append old-notes (cl-subseq new-notes 0 gnosis-new-notes-limit))))) (defun gnosis-review-get-due-tags () "Return a list of due note tags." -- cgit v1.2.3