summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-03 18:40:26 +0200
committerThanos Apollo <[email protected]>2024-01-04 04:26:01 +0200
commitd4c65c34fb4f9d1e71e5a1170a87e71e29db5c24 (patch)
tree7c21a8ea9139e48908e7dfb5de51ed1a616df8ff /gnosis.el
parent439e83a689224ec24325a93a2602107b268725c2 (diff)
Add gnosis-get-deck-due-notes
Get due notes of specified deck-id
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el12
1 files changed, 11 insertions, 1 deletions
diff --git a/gnosis.el b/gnosis.el
index 34fd4dd..49e4dc5 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -652,6 +652,16 @@ Optionally, add cusotm PROMPT."
t
nil))
+(defun gnosis-get-deck-due-notes (&optional deck-id)
+ "Return due notes for deck, with value of DECK-ID.
+
+if DUE is t, return only due notes"
+ (let* ((deck (or deck-id (gnosis--get-deck-id)))
+ (notes (gnosis-select 'id 'notes `(= deck-id ,deck))))
+ (cl-loop for note in (apply #'append notes)
+ when (not (gnosis-suspended-p note))
+ collect note)))
+
(defun gnosis-tag-prompt (&optional prompt match)
"PROMPT user to select tags, until they enter `q'.
Prompt user to select tags, generated from `gnosis-get-tags--unique'.
@@ -1000,7 +1010,7 @@ SECOND-IMAGE: Image to display after user-input"
(gnosis-select-by-tag
(list (completing-read "Start session for tag: "
(gnosis-review-due-notes--with-tags))))))
- ("Notes with tag(s)" (gnosis-review--session (gnosis-select-by-tag (gnosis-tag-prompt nil t)))))))
+ ("All notes of tag(s)" (gnosis-review--session (gnosis-select-by-tag (gnosis-tag-prompt nil t)))))))
;;; Database Schemas
(defvar gnosis-db-schema-decks '([(id integer :primary-key :autoincrement)