unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* A more demanding yes-or-no and a wordlists package
@ 2023-09-28 21:11 Yuval Langer
  2023-09-30 19:20 ` Marcin Borkowski
  2023-10-07 19:53 ` Yuval Langer
  0 siblings, 2 replies; 3+ messages in thread
From: Yuval Langer @ 2023-09-28 21:11 UTC (permalink / raw)
  To: help-gnu-emacs

People often alias yes-or-no with y-or-n, which is a less demanding
confirmation function.

I thought, hey, what about aliasing yes-or-no with something even more
demanding to avoid confirming stuff accidentally?

I had a few ideas which I plan on implementing:

One idea (Google's Gmail's Drunk Mode) is to ask the user to solve a
small arithmetic problem, which I haven't yet implemented.

Another idea given by a friend was to prompt something like this with
randomly capitalised letters:

"If yOU undERstanD what you'rE doing, enter the capitalized letters here:"

What I did do is write a function which asks the user to write a
sequence of randomly selected words from a wordlist in order to
confirm, and another to decline. [1] Right now it only uses a dummy
wordlist, but I have also written another package which provides a
selection of publicly known wordlists, which the first package would
be dependent on.

The wordlist package [2] bundles publicly known worslists such as the
Diceware wordlists and the EFF wordlists.  I took the original files
as they are from those projects, and produce vectors of strings, each
vector is a wordlist.

It might just be my horrid code, but it takes a noticeable amount of
time to produce the vectors.  How should I cache the results of the
wordlist producing functions?

Another concern is that this solution takes a lot of memory?  Could I
make this dependency optional in the super-duper-yes-or-no package?

This is partly an exercise in learning Emacs Lisp, but maybe someone
would find it useful?

p.s. I haven't yet created their https://sr.ht/ homes, so they are
still only up on https://codeberg.org/

[1]: <https://codeberg.org/yuvallangerontheroad/super-duper-yes-or-no>
[2]: <https://codeberg.org/yuvallangerontheroad/emacs-wordlists>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-07 19:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).