unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Yuval Langer <yuval.langer@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: A more demanding yes-or-no and a wordlists package
Date: Sat, 07 Oct 2023 19:53:30 +0000	[thread overview]
Message-ID: <6B2A2F2B-D102-42BA-9F27-A86F1EB1DE7A@gmail.com> (raw)
In-Reply-To: <E9EB0890-FFBE-4AEA-9616-10F9415A45FD@gmail.com>

On September 28, 2023 9:11:29 PM UTC, Yuval Langer <yuval.langer@gmail.com> wrote:
>I thought, hey, what about aliasing yes-or-no with something even more
>demanding to avoid confirming stuff accidentally?

I now have three yes-or-no-p replacements.

One, super-duper-yes-or-no-yes-or-no-words-p, takes a prompt string and displays the prompt and two random non-identical sequences of words in the minibuffer.  One for affirmative, the other for negative.  The user must enter one of them for the function to return.

Running:

(super-duper-yes-or-no-yes-or-no-words-p "Do some action? ")

Displays:

Do some action? (Enter "aaaaa foo" for yes, "aaaaa aaaaa" for no)

The user then must enter exactly, without the doube quotes, "aaaaa foo" for yes and "aaaaa aaaaa" for no.

The second, super-duper-yes-or-no-yes-or-no-toggle-case-p, takes a prompt string, and displays the prompt and two phrases with a small number of the letters' case flipped.  The use must enter the letters in sequence as they appear in the phrases for the function to return.

Running:

(super-duper-yes-or-no-yes-or-no-toggle-case-p "Do some
action? ")

Displays:

Do some action? (If you Understand what you're Doing, enter the
capitalIzed letters here for "yEs")
(If you understaNd what you're doiNg, enter the capitaLized letters
here for "no"):

Enter "IUDIE" for yes and "INNL" for no.

The third, sd-yes-or-no-arithmetic-problem-p, the same as the above, but with simple arithmetic problems:

Running:

(super-duper-yes-or-no-yes-or-no-arithmetic-problem-p "Do some
action? ")

Displays:

Do some action? Please answer (+ (* 8 0) (* 1 0)) for "yes" and (+
(* 8 2) (* 2 1)) for "no":

Enter "9" for yes and "18" for no.

There are several customizable variables one can set.  The docstrings explain them.

The only repository online currently is on <https://codeberg.org/yuvallangerontheroad/super-duper-yes-or-no> but I am not sure if I should move it to Source Hut or not.

Anyway, I would appreciate advice, any advice!

Thank you,
Yuval Langer.


      parent reply	other threads:[~2023-10-07 19:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 21:11 A more demanding yes-or-no and a wordlists package Yuval Langer
2023-09-30 19:20 ` Marcin Borkowski
2023-10-07 19:53 ` Yuval Langer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6B2A2F2B-D102-42BA-9F27-A86F1EB1DE7A@gmail.com \
    --to=yuval.langer@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).