Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,37 +0,0 @@
|
|||
(let ((prompt-buffer-name "***** prompt *****")
|
||||
(option-list '("fee fie"
|
||||
"huff and puff"
|
||||
"mirror mirror"
|
||||
"tick tock"))
|
||||
(extra-prompt-message "")
|
||||
(is-selected nil)
|
||||
(user-input-value nil))
|
||||
|
||||
;; Switch to an empty buffer
|
||||
(switch-to-buffer-other-window prompt-buffer-name)
|
||||
(read-only-mode -1)
|
||||
(erase-buffer)
|
||||
;; Display the options
|
||||
(cl-loop for opt-idx from 1 to (length option-list) do
|
||||
(insert (format "%d\) %s \n" opt-idx (nth (1- opt-idx) option-list))))
|
||||
|
||||
(while (not is-selected)
|
||||
;; Read user input
|
||||
(setq user-input-value (read-string (concat "select an option" extra-prompt-message " : ")))
|
||||
(setq user-input-value (read user-input-value))
|
||||
;; Validate user input
|
||||
(if (and (fixnump user-input-value)
|
||||
(<= user-input-value (length option-list))
|
||||
(> user-input-value 0))
|
||||
;; Display result
|
||||
(progn
|
||||
(end-of-buffer)
|
||||
(insert (concat "\nYou selected: " (nth (1- user-input-value) option-list)))
|
||||
(setq is-selected 't)
|
||||
)
|
||||
(progn
|
||||
(setq extra-prompt-message " (please input a valid number)")
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue