diff options
author | Thanos Apollo <[email protected]> | 2023-12-28 04:05:31 +0200 |
---|---|---|
committer | Thanos Apollo <[email protected]> | 2023-12-28 04:05:31 +0200 |
commit | be7bc38c44267bcd7ac4d8d1e41cc87c8cef516a (patch) | |
tree | b10b2347ddfd383eaa46401af8e9109f70895556 /gnosis.el | |
parent | c33d0fee946abe25411286533b8e58b13f07cf6a (diff) |
Add gnosis-prompt-tag
Diffstat (limited to 'gnosis.el')
-rw-r--r-- | gnosis.el | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -369,6 +369,20 @@ Compare 2 strings, ignoring case and whitespace." (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)) + +(defun gnosis-prompt-tag () + "Prompt user to enter tags, until they enter `q'. + +Returns a list of unique entered tags." + (interactive) + (let ((tags '()) + (tag "")) + (while (not (string= tag "q")) + (setf tag (completing-read "Add tag (q for quit): " (gnosis-unique-tags) nil nil)) + (unless (or (string= tag "q") (member tag tags)) + (push tag tags))) + (reverse tags))) + ;; Review ;;;;;;;;;; (defun gnosis-review--algorithm (id success) |