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 565f5a98604f69e68d7bdbc0ac79df5e3cc8b04d
parent a1b6eff82852c2784ad6225bfbfbff188d61671f
Author: Yuval Langer <yuvallangerontheroad@gmail.com>
Date:   Sat,  7 Oct 2023 02:21:02 +0300

Add docstrings to variables and make some of them custemizable.

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

diff --git a/super-duper-yes-or-no.el b/super-duper-yes-or-no.el @@ -41,31 +41,44 @@ ;;; Code: -(defvar sd-number-of-words 2) +(defcustom sd-number-of-words 2 + "Number of words in the `sd-yes-or-no-words-p' words sequences.") (defvar sd-words ["aaaaa" "moo" "foo" - "bar"]) + "bar"] + "Words to be used by `sd-yes-or-no-words-p'.") -(defvar sd-upper-case-phrase-for-yes - "If you understand what you're doing, enter the capitalized letters here for \"yes\"") +(defcustom sd-upper-case-phrase-for-yes + "If you understand what you're doing, enter the capitalized letters here for \"yes\"" + "Phrase to be used by the \"yes\" prong of `sd-yes-or-no-toggle-case-p'.") -(defvar sd-upper-case-phrase-for-no - "If you understand what you're doing, enter the capitalized letters here for \"no\"") +(defcustom sd-upper-case-phrase-for-no + "If you understand what you're doing, enter the capitalized letters here for \"no\"" + "Phrase to be used by the \"no\" prong of `sd-yes-or-no-toggle-case-p'.") -(defvar sd-number-of-case-toggle-characters 4) +(defcustom sd-number-of-case-toggle-characters 4 + "Number of English ASCII chars to be toggled in each of the two phrases provided in `sd-yes-or-no-toggle-case-p'.") -(defvar sd-arithmetic-problem-minimum - 0) +(defcustom sd-arithmetic-problem-minimum + 0 + "Smallest integer to be used in `sd-yes-or-no-arithmetic-problem-p'.") -(defvar sd-arithmetic-problem-maximum - 10) +(defcustom sd-arithmetic-problem-maximum + 10 + "Biggest integer to be used in `sd-yes-or-no-arithmetic-problem-p'.") (defvar sd--arithmetic-problem-template '(+ (* 0 0) - (* 0 0))) + (* 0 0)) + "Template used to create arithmetic problems. + +Used by `sd-yes-or-no-arithmetic-problem-p'. + +The atomic arguments are replaced by integers and the functions +stay unchanged.") (defun sd--randint (minimum maximum) "Return an integer between MINIMUM (inclusive) and MAXIMUM (exclusive)."