summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index 589ed27..efa10ed 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -363,6 +363,12 @@ Compare 2 strings, ignoring case and whitespace."
(cl-loop for tags in (emacsql gnosis-db [:select tags :from 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."
+ (cl-loop for (id tags) in (emacsql gnosis-db [:select [id tags] :from notes])
+ when (cl-every (lambda (tag) (member tag tags)) input-tags)
+ collect id))
;; Review
;;;;;;;;;;
(defun gnosis-review--algorithm (id success)