emacs-super-duper-yes-or-no

Replace the yes-or-no function with an even more demanding yes or no prompt, rather than with y-or-n.
Log | Files | Refs | LICENSE

commit 69a032ea8cf3b2ac7cb87eb72b53b9d140f824a6
parent 503d1101cafbd432a59d3cde300eed6b5bd7b801
Author: Yuval Langer <yuvallangerontheroad@gmail.com>
Date:   Fri,  6 Oct 2023 21:36:38 +0300

Replace a while loop with a cl-loop.

Diffstat:
Msuper-duper-yes-or-no.el | 22++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/super-duper-yes-or-no.el b/super-duper-yes-or-no.el @@ -67,16 +67,18 @@ "Make a list of words, WANTED-NUMBER-OF-WORDS long. Used in the `super-duper-yes-or-no-yes-or-no-words-p' function." - (let ((words ()) - (wordlist-size (seq-length sd-words))) - (while (not (= (seq-length words) - wanted-number-of-words)) - (let* ((word-index (random wordlist-size)) - (random-word (aref sd-words - word-index))) - (setq words (cons random-word - words)))) - words)) + (let ((wordlist-size (seq-length sd-words))) + (cl-loop + for random-word-index = + (random wordlist-size) + + for random-word = + (aref sd-words + random-word-index) + + repeat wanted-number-of-words + + collect random-word))) (defun sd--make-random-yes-or-no-input-pair (number-of-words) "Make two different word lists, each NUMBER-OF-WORDS long.