diff options
author | Thanos Apollo <[email protected]> | 2023-12-28 04:05:18 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-28 04:05:18 +0200 |
commit | c33d0fee946abe25411286533b8e58b13f07cf6a (patch) | |
tree | e56d8e88a5deb8b1768910e49e935eb6d0a32373 /gnosis.el | |
parent | 8d0034663c7e6d9ad079cc1910dedb36eb802281 (diff) |
Add gnosis-select-by-tag
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) |