summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-12-14 20:40:37 +0200
committerThanos Apollo <[email protected]>2023-12-14 20:40:37 +0200
commitdd40cde2399089ab28a62a32fec32320fa7f2ba0 (patch)
treea7571c38977886565ddb4b841915c784b5b51efe
parent39cf9fdc3f8ef342bf95000007cb7f950b0367d3 (diff)
Update gnosis--ask-input
- Remove animate as well
-rw-r--r--gnosis.el25
1 files changed, 14 insertions, 11 deletions
diff --git a/gnosis.el b/gnosis.el
index 1e87819..fcf94fc 100644
--- a/gnosis.el
+++ b/gnosis.el
@@ -101,20 +101,23 @@ Example:
(defun gnosis--display-question (id)
"Display main row for question ID."
(let ((question (gnosis-get 'main 'notes `(= id ,id))))
- ;; Animate.el is used only for testing purposes.
- (animate-string question 1)))
+ (erase-buffer)
+ (insert question 1)
+ (sit-for 0.5)))
(defun gnosis--ask-input (prompt)
"PROMPT user for input until `q' is given.
-
-The user is prompted to provide input for the 'PROMPT' message, and
-the returns the list of inputs in reverse order."
- (let ((input nil))
- (while (not (equal (car input) "q"))
- (add-to-list 'input (read-string (concat prompt " (q for quit): "))))
- (when (equal (car input) "q")
- (pop input))
- (reverse input)))
+
+ The user is prompted to provide input for the 'PROMPT' message, and
+ the returns the list of inputs in reverse order."
+ (let ((input-list nil)
+ (input ""))
+ (while (not (string= input "q"))
+ (setq input (read-string (concat prompt " (q for quit): ")))
+ (push input input-list))
+ (when (string= (car input-list) "q")
+ (pop input-list))
+ (nreverse input-list)))
(defun gnosis-add-deck (name)
"Create deck with NAME."