summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-01-04 16:33:19 +0200
committerThanos Apollo <[email protected]>2024-01-06 08:29:11 +0200
commitcb423765a09dbf04e022b3073f94b580333c9441 (patch)
tree532dc1e7fad2fdabf83f5def284a2a9b4abf3fef /gnosis.el
parent049c5384dd6c8f915dbd25782cfa96ea960eaa44 (diff)
Update gnosis-get-tags--unique
Flatten returned list
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/gnosis.el b/gnosis.el
index e654db6..6661bd9 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -681,12 +681,12 @@ Optionally, add cusotm PROMPT."
(defun gnosis-get-tags--unique ()
"Return a list of unique strings for tags in gnosis-db."
- (cl-loop for tags in (gnosis-select 'tags 'notes)
+ (cl-loop for tags in (apply #'append (gnosis-select 'tags 'notes))
nconc tags into all-tags
finally return (delete-dups all-tags)))
(defun gnosis-select-by-tag (input-tags)
- "Return note id for every note with INPUT-TAGS."
+ "Return note ID's for every note with INPUT-TAGS."
(unless (listp input-tags)
(error "`input-tags' need to be a list"))
(cl-loop for (id tags) in (emacsql gnosis-db [:select [id tags] :from notes])
@@ -1202,7 +1202,7 @@ review."
(pcase review-type
("Due notes" (gnosis-review--session (gnosis-review-get-due-notes)))
("Due notes of deck" (gnosis-review--session (gnosis-get-deck-due-notes)))
- ("Due notes of specified tag(s)" (gnosis-review--session (gnosis-tag-prompt :match t :due t)))
+ ("Due notes of specified tag(s)" (gnosis-review--session (gnosis-select-by-tag (gnosis-tag-prompt :match t :due t))))
("All notes of tag(s)" (gnosis-review--session (gnosis-select-by-tag (gnosis-tag-prompt :match t)))))))
;;; Database Schemas