summaryrefslogtreecommitdiff
path: root/gnosis.el
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2024-02-22 13:49:10 +0200
committerThanos Apollo <[email protected]>2024-02-22 13:49:10 +0200
commitf00f5846b954a49e1daa3abfb041427157c8ee92 (patch)
treeb3ae32adbf4b384ee35913259ef9cea995249c7f /gnosis.el
parentb12e5956b8c600d617ba3b817172c32149aa84ea (diff)
Add gnosis-prompt-tags--split
Redo input of tags when creating choices. Make it simplier and easier.
Diffstat (limited to 'gnosis.el')
-rw-r--r--gnosis.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/gnosis.el b/gnosis.el
index e8ea3cc..fdf048c 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -862,6 +862,16 @@ Returns a list of unique tags."
(choices (mapcar (lambda (string) (replace-regexp-in-string "{\\|}" "" string)) input)))
(list choices (+ correct-choice-index 1))))
+(defun gnosis-prompt-tags--split (&optional previous-note-tags)
+ "Prompt user for tags, split string by space.
+
+Return a list of tags, split by space. If PREVIOUS-NOTE-TAGS is
+provided, use it as the default value."
+ (let* ((previous-note-tags (or nil previous-note-tags))
+ (tags (split-string (read-from-minibuffer "Tags: " (mapconcat #'identity previous-note-tags " ")) " ")))
+ (setf gnosis-previous-note-tags tags)
+ tags))
+
;; Review
;;;;;;;;;;
(defun gnosis-review-is-due-p (note-id)