From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Yuval Langer Newsgroups: gmane.emacs.help Subject: A more demanding yes-or-no and a wordlists package Date: Thu, 28 Sep 2023 21:11:29 +0000 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9641"; mail-complaints-to="usenet@ciao.gmane.io" To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Thu Sep 28 23:12:30 2023 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qlyJB-0002Dm-HS for geh-help-gnu-emacs@m.gmane-mx.org; Thu, 28 Sep 2023 23:12:29 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qlyIX-0000dP-QK; Thu, 28 Sep 2023 17:11:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qlyIW-0000dG-0q for help-gnu-emacs@gnu.org; Thu, 28 Sep 2023 17:11:48 -0400 Original-Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qlyIM-0007gk-5F for help-gnu-emacs@gnu.org; Thu, 28 Sep 2023 17:11:45 -0400 Original-Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-406556f9bf9so6894285e9.2 for ; Thu, 28 Sep 2023 14:11:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695935495; x=1696540295; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:subject:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=SlaUA4VnK79zm5Hp79QB4Ll5NMixEIDfIhluIqIO5L8=; b=hE+8ADO5VlGBVLL5HHLZXBQPESF9dKf/vcoMo+OREqmCbUW7ibozXId0YI5Xtow2Oa lo/pLjKAAECuinu22JWZmJz3mrw+suQwxlzJwlH5CyZtRgV/kZXgX6jmwFNci2JthFz/ 8SBSkNso68JuwQnzUj1VFsGBqRo8TXDwc90amHANYfST10Ld2CSgVdInMb/CqDlDUZmh JNts9hJJUcW1ElLmqfcrBySxDJLW8Uilp01LSM5e4I7dYH5KqhfTJfyUaVM/AlbtSlKK MYr/xcafYRpwATG7oFfTPyasnEmLPaG3X+dsX3fKpWyIKsNqvWcZc+bcYsxbLnitXMdU ZBDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695935495; x=1696540295; h=content-transfer-encoding:mime-version:message-id:subject:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SlaUA4VnK79zm5Hp79QB4Ll5NMixEIDfIhluIqIO5L8=; b=A2fviCd0w6EXJ6eQpA9VaRVXwVHCPl2OdiHcg7undyETib9ByxDGvkEgYeq4F3wSl7 A50P8IIKGvNbr8N4qG1b0Ms4HDEBToZtgXpfoCvnWffMbrwTbnHgq6mAVv/l759xkaFG hVpp0L0r3gDWM+C5sv2angfh/oNwiLb9WLXhOGSHC6keN68VbG/iWNh7Bb5ejNoR1p6E XCO2OozJd+TTapWWt6mc8ifHzlVyVa9jJIXBtY4WO+mvHjebKVBWgPmb2TXSqDrx6AXr Pnm+1sPo9T2IbvHOVXkf62AEFs4Q/cmt2oktpY+ZzCZgn2Na7lm+BajYxGw4nRAUhcOD G1ZA== X-Gm-Message-State: AOJu0YyEG/C81xGeGnXM3qw53q4AGTr6YJbMyGZNeUj6T+yMP4mMrJrP XqK2ssyv6iVJTNOP/hjkaKcWG4gPczM= X-Google-Smtp-Source: AGHT+IGyAfnEJ3p9q6B44s3mcQnUpZjtegam1Bv/URJ4Sks1MyexaVLByDWodOcDZM7MVWutzoTFAQ== X-Received: by 2002:adf:f085:0:b0:320:77f:a97c with SMTP id n5-20020adff085000000b00320077fa97cmr2298020wro.63.1695935494677; Thu, 28 Sep 2023 14:11:34 -0700 (PDT) Original-Received: from ?IPv6:::1? ([2a06:c701:9cc1:ea00:81e2:b5ec:e246:c948]) by smtp.gmail.com with ESMTPSA id 11-20020a056000156b00b0032485046055sm2251047wrz.5.2023.09.28.14.11.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Sep 2023 14:11:33 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=yuval.langer@gmail.com; helo=mail-wm1-x329.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:145176 Archived-At: People often alias yes-or-no with y-or-n, which is a less demanding confirmation function=2E 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=2E 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=2E [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=2E The wordlist package [2] bundles publicly known worslists such as the Diceware wordlists and the EFF wordlists=2E I took the original files as they are from those projects, and produce vectors of strings, each vector is a wordlist=2E It might just be my horrid code, but it takes a noticeable amount of time to produce the vectors=2E 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=2Es=2E I haven't yet created their https://sr=2Eht/ homes, so they are still only up on https://codeberg=2Eorg/ [1]: [2]: