help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A more demanding yes-or-no and a wordlists package


From: Yuval Langer
Subject: A more demanding yes-or-no and a wordlists package
Date: Thu, 28 Sep 2023 21:11:29 +0000

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>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]