summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-01 13:03:48 +0200
committerThanos Apollo <[email protected]>2024-01-01 13:04:03 +0200
commit5f7209509ac84945de10ed3f452a146ac96b38cf (patch)
tree3c3bca1e54555e59c6cdc90f36dc275b385d899e
parent08d540fc837e156b21ee35e4eeaea1788ea0b3d0 (diff)
gnosis-review-get-due-notes: Flatten returned list
-rw-r--r--gnosis.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/gnosis.el b/gnosis.el
index 2d23fd9..e79448f 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -583,20 +583,21 @@ Returns a list of the form ((yyyy mm dd) ef)."
(= id ,note-id))]))
(defun gnosis-review-get-due-notes ()
- "Get due notes id for current date.
+ "Return a list due notes id for current date.
Select notes where:
- Next review date <= current date
- Not suspended."
- (emacsql gnosis-db `[:select [id] :from review-log :where (and (<= next-rev ',(gnosis-algorithm-date))
- (= suspend 0))]))
+ (apply #'append
+ (emacsql gnosis-db `[:select [id] :from review-log :where (and (<= next-rev ',(gnosis-algorithm-date))
+ (= suspend 0))])))
(defun gnosis-review-due-notes--with-tags ()
"Return a list of due note tags."
(let ((due-notes (gnosis-review-get-due-notes)))
(cl-remove-duplicates
(cl-mapcan (lambda (note-id)
- (gnosis-get-note-tags (car note-id)))
+ (gnosis-get-note-tags note-id))
due-notes)
:test 'equal)))