summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-28 07:33:30 +0200
committerThanos Apollo <[email protected]>2023-12-28 07:33:30 +0200
commit962048711ceb5ccc9ad68fafe6e2bc849f5ebd8e (patch)
tree511357c92a53549e2fb9ffb5249ef679d09bac63
parent4cb80ac12ad21eb13a48e2b54edb3c3d91600514 (diff)
Rewrite gnosis-review-all-due-notes
-rw-r--r--gnosis.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/gnosis.el b/gnosis.el
index 17fcf3c..fb36bf6 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -561,19 +561,21 @@ If user-input is equal to CLOZE, return t."
(while (y-or-n-p "Review next note?")
(gnosis-review-note note)))
finally (message "Review session finished"))))
+(defun gnosis-review-all-due-notes ()
+ "Review all due notes."
(let* ((due-notes (gnosis-review-get-due-notes))
(note-count 0)
(total-notes (length due-notes)))
(if (null due-notes)
(message "No due notes.")
- (cl-loop for note in due-notes
- do (progn
- (gnosis-review-note (car note))
- (setf note-count (+ note-count 1))
- (when (and (< note-count total-notes)
- (not (y-or-n-p "Review next note?")))
- (cl-return)))
- finally (message "Review session finished. %d note(s) reviewed." note-count)))))
+ (when (y-or-n-p (format "You have %s total notes for review, start session?" total-notes))
+ (cl-loop for note in due-notes
+ do (progn
+ (gnosis-review-note (car note))
+ (setf note-count (+ note-count 1))
+ (when (not (y-or-n-p "Review next note?"))
+ (cl-return)))
+ finally (message "Review session finished. %d note(s) reviewed." note-count))))))
;;; Database Schemas
;; Enable foreign_keys