From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 10 Jan 2018 21:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 30073@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.151562069213441 (code B ref -1); Wed, 10 Jan 2018 21:45:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jan 2018 21:44:52 +0000 Received: from localhost ([127.0.0.1]:51430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZOB2-0003Uj-0h for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZOB0-0003UW-MY for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZOAu-0006Si-NL for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZOAu-0006SG-Cg for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZOAt-0004yE-9X for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZOAr-0006PA-8e for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:43 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:51829 helo=homiemail-a100.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZOAr-0006Ol-2U for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:41 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 0C63B31A073 for ; Wed, 10 Jan 2018 13:44:40 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id 609FD31A070 for ; Wed, 10 Jan 2018 13:44:39 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET Date: Wed, 10 Jan 2018 23:41:10 +0200 Message-ID: <87bmi1cryh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I customized =E2=80=98yes-or-no-p=E2=80=99 in ~/.emacs to short answers: (fset 'yes-or-no-p 'y-or-n-p) but now =E2=80=98dired-do-delete=E2=80=99 ignores this customization, and= always requires typing a full answer =E2=80=9Cyes=E2=80=9D with RET when deleting recursi= vely all subdirs, instead of accepting just a single letter =E2=80=98y=E2=80=99 as before t= he recent change. I think in this case better is to accept =E2=80=98y=E2=80=99 for =E2=80=9C= yes=E2=80=9D, and =E2=80=98!=E2=80=99 for =E2=80=9Call=E2=80=9D like in =E2=80=98query-replace-map=E2=80=99. From debbugs-submit-bounces@debbugs.gnu.org Wed Jan 10 17:52:46 2018 Received: (at control) by debbugs.gnu.org; 10 Jan 2018 22:52:46 +0000 Received: from localhost ([127.0.0.1]:51478 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZPEj-00052x-VL for submit@debbugs.gnu.org; Wed, 10 Jan 2018 17:52:46 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49031) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZPEg-00052j-Id for control@debbugs.gnu.org; Wed, 10 Jan 2018 17:52:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZPEZ-0004es-TC for control@debbugs.gnu.org; Wed, 10 Jan 2018 17:52:36 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:34127) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZPEZ-0004ej-OR for control@debbugs.gnu.org; Wed, 10 Jan 2018 17:52:35 -0500 Received: from rgm by fencepost.gnu.org with local (Exim 4.82) (envelope-from ) id 1eZPEZ-00030E-Hv for control@debbugs.gnu.org; Wed, 10 Jan 2018 17:52:35 -0500 Subject: control message for bug 30073 To: X-Mailer: mail (GNU Mailutils 2.99.98) Message-Id: From: Glenn Morris Date: Wed, 10 Jan 2018 17:52:35 -0500 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) merge 28525 30073 From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 03:01:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151563965315690 (code B ref 30073); Thu, 11 Jan 2018 03:01:02 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 03:00:53 +0000 Received: from localhost ([127.0.0.1]:51562 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZT6r-00044z-HP for submit@debbugs.gnu.org; Wed, 10 Jan 2018 22:00:53 -0500 Received: from mail-wm0-f49.google.com ([74.125.82.49]:43718) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZT6o-00044k-T1 for 30073@debbugs.gnu.org; Wed, 10 Jan 2018 22:00:51 -0500 Received: by mail-wm0-f49.google.com with SMTP id g1so2608611wmg.2 for <30073@debbugs.gnu.org>; Wed, 10 Jan 2018 19:00:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=1wApUeO/10AiO4f27gk1UWEmSQW27i1+FzY/A4XCGgA=; b=Cn9VNoxUFpDIyBJSM4Qy6yHhZUVSL8O9++jwl0NfAWssCd0UHFOUJJuaya+wLWoPPL BmXg+etDzMyBAP9aaVv8dM2FK1ySHmcpR4DRJoN92bMOBxqK5tkvH4iOIxBTzpOb4gkA dhLtGyVdQOcoDB/jK8h7KO1E395EdDE8qU3XjojAaajDGydPC7ASgwTYOBvckL2pLR4a 02krv7rmINXzxGMq78vPZTu3hC+tzx1XawTYFM5M0VLxtDp79+q6uYtiMsE2Na1aD4cK 1BHGXz0a91QlYe28QKAdR9Ikb0rMPoQAahZY6tYD+LiPJrtzmAOy+XJwpiLrAwFzfd7j 3Bzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=1wApUeO/10AiO4f27gk1UWEmSQW27i1+FzY/A4XCGgA=; b=BtTdcESgN+kCJdYf5UCY9c/bvVBjsWJTam2pkt9/Gd6B8RMFGlYj1A6cRILoic2b5l XdtKWRDV/hR/Qzdt9eihDRT9f007UqrSSkpyRPuOlGT0BQVR1t/ozIQdGMeNpQskKxSz OLKRk6M87CqCGkCuzl5WtKoOlLCm5bNC375xGskVBWYKCm9heud4x2xSA3Aa/ZsKNEcr sIWnICXrlTbsZ/TdzAFd5E7p6Wo5HS+es1ZIYrTuGY3RfiX/bS5bpczSLkYcinc9FBet xDcZAIOkGTQvCV73h7pCNOH8r7dVaGiOGWNRktGSkO8vZo4MBU0ma74ThKTegEM4tKke z/bA== X-Gm-Message-State: AKGB3mJBzL67S3vff4RaCGajilvwKICGNhGQ/orFvH2EqRPeN3Qv8T7Q E2OGO0ZUbwzo5C3g6VuQ2DPvhS4f X-Google-Smtp-Source: ACJfBosls9K4eytoIgt6suMHp/5LLTTIZvyPliBqo2ilKKwABpwqXSmagvrfc3z/EmfNRicZHwt3LQ== X-Received: by 10.80.149.243 with SMTP id x48mr28690107eda.13.1515639645079; Wed, 10 Jan 2018 19:00:45 -0800 (PST) Received: from localhost ([2a02:8084:4f41:8c80:9929:5bdb:4629:fab8]) by smtp.gmail.com with ESMTPSA id w17sm111101eda.96.2018.01.10.19.00.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Jan 2018 19:00:44 -0800 (PST) From: "Basil L. Contovounesios" References: <87bmi1cryh.fsf@mail.linkov.net> Date: Thu, 11 Jan 2018 03:00:38 +0000 In-Reply-To: <87bmi1cryh.fsf@mail.linkov.net> (Juri Linkov's message of "Wed, 10 Jan 2018 23:41:10 +0200") Message-ID: <87o9m1nlpl.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Juri Linkov writes: > I customized =E2=80=98yes-or-no-p=E2=80=99 in ~/.emacs to short answers: > > (fset 'yes-or-no-p 'y-or-n-p) > > but now =E2=80=98dired-do-delete=E2=80=99 ignores this customization, and= always requires > typing a full answer =E2=80=9Cyes=E2=80=9D with RET when deleting recursi= vely all subdirs, > instead of accepting just a single letter =E2=80=98y=E2=80=99 as before t= he recent change. > > I think in this case better is to accept =E2=80=98y=E2=80=99 for =E2=80= =9Cyes=E2=80=9D, and =E2=80=98!=E2=80=99 for =E2=80=9Call=E2=80=9D > like in =E2=80=98query-replace-map=E2=80=99. Just linking bug#27940, where the move away from using yes-or-no-p in function dired-delete-file was discussed: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27940 --=20 Basil From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 15:53:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 30073@debbugs.gnu.org, juri@linkov.net Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15156859804788 (code B ref 30073); Thu, 11 Jan 2018 15:53:02 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 15:53:00 +0000 Received: from localhost ([127.0.0.1]:52352 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZfA3-0001F9-OG for submit@debbugs.gnu.org; Thu, 11 Jan 2018 10:52:59 -0500 Received: from eggs.gnu.org ([208.118.235.92]:50597) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZfA2-0001Ex-Cp for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 10:52:58 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZf9t-0002QT-3k for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 10:52:53 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48753) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZf9t-0002QI-0K; Thu, 11 Jan 2018 10:52:49 -0500 Received: from [176.228.60.248] (port=3090 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eZf9s-0002g8-GK; Thu, 11 Jan 2018 10:52:48 -0500 Date: Thu, 11 Jan 2018 17:52:45 +0200 Message-Id: <83po6g4cky.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87o9m1nlpl.fsf@gmail.com> (contovob@tcd.ie) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: "Basil L. Contovounesios" > Date: Thu, 11 Jan 2018 03:00:38 +0000 > Cc: 30073@debbugs.gnu.org > > Juri Linkov writes: > > > I customized ‘yes-or-no-p’ in ~/.emacs to short answers: > > > > (fset 'yes-or-no-p 'y-or-n-p) > > > > but now ‘dired-do-delete’ ignores this customization, and always requires > > typing a full answer “yes” with RET when deleting recursively all subdirs, > > instead of accepting just a single letter ‘y’ as before the recent change. > > > > I think in this case better is to accept ‘y’ for “yes”, and ‘!’ for “all” > > like in ‘query-replace-map’. > > Just linking bug#27940, where the move away from using yes-or-no-p in > function dired-delete-file was discussed: > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=27940 Indeed, this horse has been beaten to death already. The current solution is for you to set dired-deletion-confirmer to y-or-n-p. Admittedly, that's not a very user-friendly customization method, but then neither is fset. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 17:35:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Cc: Eli Zaretskii , 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151569207014205 (code B ref 30073); Thu, 11 Jan 2018 17:35:01 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 17:34:30 +0000 Received: from localhost ([127.0.0.1]:52425 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZgkI-0003h2-7M for submit@debbugs.gnu.org; Thu, 11 Jan 2018 12:34:30 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37814) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZgkH-0003gq-4h for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 12:34:29 -0500 Received: by mail-wm0-f47.google.com with SMTP id f140so6906850wmd.2 for <30073@debbugs.gnu.org>; Thu, 11 Jan 2018 09:34:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=splVvNsT6io9iCq9hPJ84dFpI+moBndoLE1mfCrBOg4=; b=BJyEXq+c4zkVPDJmjXEfbdO13OBvOzxds5vcPjsT5/uDI8LRAlHt3AhiKaq8wbdOS0 cFmT+sg2p7rCJZkJ/2uw3T0Y++YXtTYsdIz3DOBEBoWzEE+qmV1KEk/HO/FaPNEWuQi+ DErbuTj75PRs1RMagxZDZXUtqqcUAVOD6aApF8NBXCC6+52LEHAnQxuidFygTS1vI3ih BPQNghKx5Kw2Bi0acvHwwRpkT3ViSxrhYmmNlWkBN/0fRJgncEGL962bdtYRLwTVRBAy 1A4Yu8GLJXz5iD29JudqUupzgGmnTbiogJvEph6t0lJbeFjFu+7gKt+RHJeALyUOOHkk 1+tQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=splVvNsT6io9iCq9hPJ84dFpI+moBndoLE1mfCrBOg4=; b=BbOWgEgbptrbn4hrvFXYG0M5Do8Qnk9nDJcGFodCkz1wU4kUFyotBOgjUdigFjCwBm pxFiqb9M7t8aIyOV3Hes7Uf2nDBFEsSrwrRLfVovsuToi6HvaE6wRIwbT/p5KSbRP/wQ zwvi0kwbdpfEW/BnMlJLtqtvJXyeasrGCiW3Y+UXRMqgNZvj2ua/JIh9k6XXi7kjUW0T pPhHqk2AT57WP/TW7YF9VS4Ub3sNDIYHYpjnbzwAG1VdznYEG18xQamdK04rfmFp7760 YSC6j0nBagTZj+NeqC3Yb4iiGCnBcccVG7yhEDohqYxcnQloFk5VkXHSqW9uE21Hum2o Y3uw== X-Gm-Message-State: AKwxytcdJEeh+6kvFjRU38EsYIjA9U3VYNBeCw8oAaHSpx6ZoKoumuSl 4wT740lP6XEPOysUiTwmFUAmSA== X-Google-Smtp-Source: ACJfBov7qWPLnTwAEYVteLhrPogMjmHXRWdZ7jn8kEXfKnoUb7iY7KwyDTjzJnzT8hZBp8glf8ITow== X-Received: by 10.80.181.130 with SMTP id a2mr9584118ede.287.1515692063087; Thu, 11 Jan 2018 09:34:23 -0800 (PST) Received: from localhost ([213.233.148.18]) by smtp.gmail.com with ESMTPSA id p93sm11065147edp.14.2018.01.11.09.34.22 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 09:34:22 -0800 (PST) From: "Basil L. Contovounesios" References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> Date: Thu, 11 Jan 2018 17:34:21 +0000 In-Reply-To: <83po6g4cky.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jan 2018 17:52:45 +0200") Message-ID: <87k1woti3m.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Eli Zaretskii writes: >> Juri Linkov writes: >>=20 >> > I customized =E2=80=98yes-or-no-p=E2=80=99 in ~/.emacs to short answer= s: >> > >> > (fset 'yes-or-no-p 'y-or-n-p) >> > >> > [...] > > [...] > > Indeed, this horse has been beaten to death already. The current > solution is for you to set dired-deletion-confirmer to y-or-n-p. > Admittedly, that's not a very user-friendly customization method, but > then neither is fset. FWIW, I find (advice-add 'yes-or-no-p :override #'y-or-n-p) to be a slightly user-friendlier alternative to (fset 'yes-or-no-p 'y-or-n-p) as the former is at least reported by the help system. --=20 Basil From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 18:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: "Basil L. Contovounesios" Cc: 30073@debbugs.gnu.org, juri@linkov.net Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151569369816631 (code B ref 30073); Thu, 11 Jan 2018 18:02:01 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 18:01:38 +0000 Received: from localhost ([127.0.0.1]:52442 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZhAY-0004KB-CW for submit@debbugs.gnu.org; Thu, 11 Jan 2018 13:01:38 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45219) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZhAV-0004Jy-Bk for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 13:01:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZhAM-0007Tk-UL for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 13:01:30 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:51628) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZhAM-0007Te-Qc; Thu, 11 Jan 2018 13:01:26 -0500 Received: from [176.228.60.248] (port=3192 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eZhAM-0005Lb-Aa; Thu, 11 Jan 2018 13:01:26 -0500 Date: Thu, 11 Jan 2018 20:01:23 +0200 Message-Id: <838td446mk.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87k1woti3m.fsf@gmail.com> (contovob@tcd.ie) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87k1woti3m.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: "Basil L. Contovounesios" > Cc: Eli Zaretskii , <30073@debbugs.gnu.org> > Date: Thu, 11 Jan 2018 17:34:21 +0000 > > > Indeed, this horse has been beaten to death already. The current > > solution is for you to set dired-deletion-confirmer to y-or-n-p. > > Admittedly, that's not a very user-friendly customization method, but > > then neither is fset. > > FWIW, I find > > (advice-add 'yes-or-no-p :override #'y-or-n-p) > > to be a slightly user-friendlier alternative to > > (fset 'yes-or-no-p 'y-or-n-p) > > as the former is at least reported by the help system. IMO, none of that is user-friendly as customization goes. These are semi-kludgey hacks, which are okay for personal use, but not as advertised customization means. YMMV, of course. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: "Basil L. Contovounesios" Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 19:41:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: 30073@debbugs.gnu.org, juri@linkov.net Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151569961225103 (code B ref 30073); Thu, 11 Jan 2018 19:41:01 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 19:40:12 +0000 Received: from localhost ([127.0.0.1]:52472 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZihr-0006Wi-LD for submit@debbugs.gnu.org; Thu, 11 Jan 2018 14:40:12 -0500 Received: from mail-wm0-f42.google.com ([74.125.82.42]:43807) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZihl-0006W5-7p for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 14:40:06 -0500 Received: by mail-wm0-f42.google.com with SMTP id g1so7712534wmg.2 for <30073@debbugs.gnu.org>; Thu, 11 Jan 2018 11:40:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tcd-ie.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=1GFo0E6A/9pZ5kwwH9Y4IKqukfSq3wk+Bl20BbvK5JE=; b=MhGQ6qtLbr+ectRtiMQHbqYz03Ael8jSpjJIG5fpQyvluWSau6acK99WMkBryKNv8J 7EVsx3y8pAsbhcAdp0gOLTNgpS9U3evva6jH0/y86NLvEgs32cJ8OQO/XsxzIiWCwVZ+ vh/CeK7YWcDhGv24A79LEQeSK/3ayM97syPVmLhaiqW1DHcm07rZEZ5X5QUhrEWWNZfI Ku0KrqFk5YtCDeHfXGZG9jwXyWwqxUojiw4YKN4D5yngBKqkMSzo3vsL5cAjThZ9wIAH gyUGLjttBY9EGUVkPxamHfX3/sFLtCqW9rHuEq1mLR91/QFKwXoE4VSuOtK+rdq0Ry7D Z0UA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=1GFo0E6A/9pZ5kwwH9Y4IKqukfSq3wk+Bl20BbvK5JE=; b=rgQusKvs6zYf3gK8CvJL+2+JUbcgfxeFsco0G2KHWXBW0a5X4PZ982NC9OJ/qPvd5m 09Bzop2knSFOI0lIJ5YC6eaV+HgR2DbEovC/Kl8+FrepAJPKq0n+hCBRf9+faDsGp5Wg X2I0ksU/WkvwEHKBS/AHAJjDkdn90A6lw/89Y2HoRhylfWvnEKP8eJFDDy9aEayfc6xf Dv6naGkV56AaRrCOW+Qw2F26iZFDQuiHUHpVMtaPfr1fpUgZ5Ud9v6UkQh3ZmuLLcQcd ayzB26cnEsUpTy6wcfzH/TvGC2zmjppIX6h9ASiAwV+bOxmvks7XTem/lnGrEwqeDt70 TQJg== X-Gm-Message-State: AKGB3mIcmMbPA+E59Cjr6cZNGb/Cds6ImU/oH3O42agXrhgHCFvlkXYu oKiZgg70bLYUo/a/FJzyB472yA== X-Google-Smtp-Source: ACJfBot/RfKzOMmCnu9p1BEshDasLWDO/fksiBZotZYEXveczG4pp8+GAHIMHuDcmlap9uiB2DFPAQ== X-Received: by 10.80.244.202 with SMTP id v10mr31547519edm.269.1515699595324; Thu, 11 Jan 2018 11:39:55 -0800 (PST) Received: from localhost ([213.233.148.21]) by smtp.gmail.com with ESMTPSA id s8sm10498967edh.51.2018.01.11.11.39.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 11 Jan 2018 11:39:54 -0800 (PST) From: "Basil L. Contovounesios" References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87k1woti3m.fsf@gmail.com> <838td446mk.fsf@gnu.org> Date: Thu, 11 Jan 2018 19:39:48 +0000 In-Reply-To: <838td446mk.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jan 2018 20:01:23 +0200") Message-ID: <87r2qwnq0r.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) Eli Zaretskii writes: >> FWIW, I find >> >> (advice-add 'yes-or-no-p :override #'y-or-n-p) >> >> to be a slightly user-friendlier alternative to >> >> (fset 'yes-or-no-p 'y-or-n-p) >> >> as the former is at least reported by the help system. > > IMO, none of that is user-friendly as customization goes. These are > semi-kludgey hacks, which are okay for personal use, but not as > advertised customization means. Oh, absolutely; I meant that only as a side note. Besides, one could argue that the means to achieving the equivalent of this hack shouldn't be any user-friendlier. -- Basil From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 22:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: "Basil L. Contovounesios" , 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151570799919928 (code B ref 30073); Thu, 11 Jan 2018 22:00:02 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 21:59:59 +0000 Received: from localhost ([127.0.0.1]:52607 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZktC-0005BM-SO for submit@debbugs.gnu.org; Thu, 11 Jan 2018 16:59:59 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:52870 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZktB-0005BE-0W for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 16:59:57 -0500 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 736BD25806A; Thu, 11 Jan 2018 13:59:56 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id 5F13325805C; Thu, 11 Jan 2018 13:59:55 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> Date: Thu, 11 Jan 2018 23:54:41 +0200 In-Reply-To: <83po6g4cky.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jan 2018 17:52:45 +0200") Message-ID: <87vag8f4da.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Just linking bug#27940, where the move away from using yes-or-no-p in >> function dired-delete-file was discussed: >> >> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D27940 > > Indeed, this horse has been beaten to death already. The current > solution is for you to set dired-deletion-confirmer to y-or-n-p. > Admittedly, that's not a very user-friendly customization method, but > then neither is fset. What is worse, it doesn't work at all - setting dired-deletion-confirmer to y-or-n-p has no effect on the question =E2=80=9CRecursively delete ...= ? =E2=80=9D. It still expects =E2=80=9C[yes, no, all, quit, help]=E2=80=9D answers, no= t short ones like =E2=80=9Cy/n/!/q/?=E2=80=9D. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Jan 2018 22:00:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: "Basil L. Contovounesios" , 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151570800219987 (code B ref 30073); Thu, 11 Jan 2018 22:00:03 +0000 Received: (at 30073) by debbugs.gnu.org; 11 Jan 2018 22:00:02 +0000 Received: from localhost ([127.0.0.1]:52610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZktG-0005C8-4y for submit@debbugs.gnu.org; Thu, 11 Jan 2018 17:00:02 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:52878 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZktE-0005BU-S8 for 30073@debbugs.gnu.org; Thu, 11 Jan 2018 17:00:01 -0500 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 4485D258068; Thu, 11 Jan 2018 14:00:00 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id 2691125805C; Thu, 11 Jan 2018 13:59:58 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87k1woti3m.fsf@gmail.com> <838td446mk.fsf@gnu.org> Date: Thu, 11 Jan 2018 23:57:01 +0200 In-Reply-To: <838td446mk.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 11 Jan 2018 20:01:23 +0200") Message-ID: <87bmi0f49e.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> FWIW, I find >> >> (advice-add 'yes-or-no-p :override #'y-or-n-p) >> >> to be a slightly user-friendlier alternative to >> >> (fset 'yes-or-no-p 'y-or-n-p) >> >> as the former is at least reported by the help system. > > IMO, none of that is user-friendly as customization goes. These are > semi-kludgey hacks, which are okay for personal use, but not as > advertised customization means. YMMV, of course. Maybe we should introduce a boolean customizable variable with a name =E2=80=98minibuffer-short-answers=E2=80=99 to be used by different packag= es that currently rely on =E2=80=98yes-or-no-p=E2=80=99. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 12 Jan 2018 09:58:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151575107226086 (code B ref 30073); Fri, 12 Jan 2018 09:58:01 +0000 Received: (at 30073) by debbugs.gnu.org; 12 Jan 2018 09:57:52 +0000 Received: from localhost ([127.0.0.1]:52884 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZw5w-0006mf-Dc for submit@debbugs.gnu.org; Fri, 12 Jan 2018 04:57:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:46230) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZw5u-0006mS-VZ for 30073@debbugs.gnu.org; Fri, 12 Jan 2018 04:57:51 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZw5m-00089y-Lf for 30073@debbugs.gnu.org; Fri, 12 Jan 2018 04:57:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:38252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZw5m-00089s-IN; Fri, 12 Jan 2018 04:57:42 -0500 Received: from [176.228.60.248] (port=3698 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eZw5l-0005Bb-R8; Fri, 12 Jan 2018 04:57:42 -0500 Date: Fri, 12 Jan 2018 11:57:21 +0200 Message-Id: <83fu7b2yda.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87vag8f4da.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 11 Jan 2018 23:54:41 +0200) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Cc: "Basil L. Contovounesios" , 30073@debbugs.gnu.org > Date: Thu, 11 Jan 2018 23:54:41 +0200 > > What is worse, it doesn't work at all - setting dired-deletion-confirmer > to y-or-n-p has no effect on the question “Recursively delete ...? ”. > It still expects “[yes, no, all, quit, help]” answers, not short ones > like “y/n/!/q/?”. If you want to use y-or-n-p there, you will have to replace dired--yes-no-all-quit-help with your own function. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 13 Jan 2018 22:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15158832166194 (code B ref 30073); Sat, 13 Jan 2018 22:41:02 +0000 Received: (at 30073) by debbugs.gnu.org; 13 Jan 2018 22:40:16 +0000 Received: from localhost ([127.0.0.1]:55214 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaUTI-0001bq-BJ for submit@debbugs.gnu.org; Sat, 13 Jan 2018 17:40:16 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:56479 helo=homiemail-a75.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaUTF-0001bh-Lj for 30073@debbugs.gnu.org; Sat, 13 Jan 2018 17:40:14 -0500 Received: from homiemail-a75.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTP id A12815EC07C; Sat, 13 Jan 2018 14:40:12 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a75.g.dreamhost.com (Postfix) with ESMTPSA id 5991B5EC072; Sat, 13 Jan 2018 14:40:11 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> Date: Sun, 14 Jan 2018 00:38:15 +0200 In-Reply-To: <83fu7b2yda.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 12 Jan 2018 11:57:21 +0200") Message-ID: <87y3l1e68y.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> What is worse, it doesn't work at all - setting dired-deletion-confirm= er >> to y-or-n-p has no effect on the question =E2=80=9CRecursively delete = ...? =E2=80=9D. >> It still expects =E2=80=9C[yes, no, all, quit, help]=E2=80=9D answers,= not short ones >> like =E2=80=9Cy/n/!/q/?=E2=80=9D. > > If you want to use y-or-n-p there, you will have to replace > dired--yes-no-all-quit-help with your own function. Thanks for the idea. Here is the first version of its implementation: diff --git a/lisp/dired.el b/lisp/dired.el index b853d64..e6a7eeb 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2997,6 +2998,8 @@ dired-recursive-deletes ;; Match anything but `.' and `..'. (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") =20 +(defvar dired-recursive-deletion-confirmer 'dired--yes-no-all-quit-help)= ;; or 'dired--y-n-!-q-? + (defconst dired-delete-help "Type: `yes' to delete recursively the current directory, @@ -3005,6 +3008,14 @@ dired-delete-help `quit' to exit, `help' to show this help message.") =20 +(defconst dired-delete-help-short + "Type: +`y' to delete recursively the current directory, +`n' to skip to next, +`!' to delete all remaining directories with no more questions, +`q' to exit, +`?' to show this help message.") + (defun dired--yes-no-all-quit-help (prompt &optional help-msg) "Ask a question with valid answers: yes, no, all, quit, help. PROMPT must end with '? ', for instance, 'Delete it? '. @@ -3028,6 +3039,56 @@ dired--yes-no-all-quit-help (setq answer (funcall input-fn))) answer)) =20 +(defvar read-short-answers + '(("y" "yes") + ("n" "no") + ("!" "all") + ("q" "quit") + ("?" "help"))) + +(defvar read-short-answer-map + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-map) + (dolist (answer read-short-answers) + (define-key map (car answer) + (lambda () + (interactive) + (delete-minibuffer-contents) + (insert (cadr answer)) + (exit-minibuffer)))) + (define-key map [remap self-insert-command] + (lambda () + (interactive) + (delete-minibuffer-contents) + (beep) + (message "Please answer `y' or `n' or `!' or `q'") + (sleep-for 2))) + map) + "Keymap used for non-blocking reading of short one-character answers."= ) + +(defun dired--y-n-!-q-? (prompt &optional help-msg) + "Ask a question with valid answers: y, n, !, q, ?. +PROMPT must end with '? ', for instance, 'Delete it? '. +If optional arg HELP-MSG is non-nil, then is a message to show when +the user answers '?'. Otherwise, default to `dired-delete-help-short'." + (let ((valid-answers (list "yes" "no" "all" "quit")) + (answer "") + (input-fn (lambda () + (read-from-minibuffer + (format "%s [y, n, !, q, ?] " prompt) nil read-shor= t-answer-map)))) + (setq answer (funcall input-fn)) + (when (string=3D answer "help") + (with-help-window "*Help*" + (with-current-buffer "*Help*" + (insert (or help-msg dired-delete-help-short))))) + (while (not (member answer valid-answers)) + (unless (string=3D answer "help") + (beep) + (message "Please answer `y' or `n' or `!' or `q'") + (sleep-for 2)) + (setq answer (funcall input-fn))) + answer)) + ;; Delete file, possibly delete a directory and all its files. ;; This function is useful outside of dired. One could change its name ;; to e.g. recursive-delete-file and put it somewhere else. @@ -3057,7 +3118,7 @@ dired-delete-file "trash" "delete") (dired-make-relative file)))) - (pcase (dired--yes-no-all-quit-help prompt) ; Prompt = user. + (pcase (apply dired-recursive-deletion-confirmer (lis= t prompt)) ; Prompt user. ('"all" (setq recursive 'always dired-recursive-del= etes recursive)) ('"yes" (if (eq recursive 'top) (setq recursive 'al= ways))) ('"no" (setq recursive nil)) ('"no" (setq recursive nil)) PS: and here is not a patch, but a diff that shows the difference between two functions to help to combine them into one later: @@ -1,22 +1,22 @@ -(defun dired--yes-no-all-quit-help (prompt &optional help-msg) - "Ask a question with valid answers: yes, no, all, quit, help. +(defun dired--y-n-!-q-? (prompt &optional help-msg) + "Ask a question with valid answers: y, n, !, q, ?. PROMPT must end with '? ', for instance, 'Delete it? '. If optional arg HELP-MSG is non-nil, then is a message to show when -the user answers 'help'. Otherwise, default to `dired-delete-help'." +the user answers '?'. Otherwise, default to `dired-delete-help-short'." (let ((valid-answers (list "yes" "no" "all" "quit")) (answer "") (input-fn (lambda () - (read-string - (format "%s [yes, no, all, quit, help] " prompt))))= ) + (read-from-minibuffer + (format "%s [y, n, !, q, ?] " prompt) nil read-shor= t-answer-map)))) (setq answer (funcall input-fn)) (when (string=3D answer "help") (with-help-window "*Help*" (with-current-buffer "*Help*" - (insert (or help-msg dired-delete-help))))) + (insert (or help-msg dired-delete-help-short))))) (while (not (member answer valid-answers)) (unless (string=3D answer "help") (beep) - (message "Please answer `yes' or `no' or `all' or `quit'") + (message "Please answer `y' or `n' or `!' or `q'") (sleep-for 2)) (setq answer (funcall input-fn))) answer)) From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jan 2018 11:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, Eli Zaretskii , 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151592772616489 (code B ref 30073); Sun, 14 Jan 2018 11:03:01 +0000 Received: (at 30073) by debbugs.gnu.org; 14 Jan 2018 11:02:06 +0000 Received: from localhost ([127.0.0.1]:55409 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eag3C-0004Hs-Eu for submit@debbugs.gnu.org; Sun, 14 Jan 2018 06:02:06 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:39275) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eag3A-0004HK-FD for 30073@debbugs.gnu.org; Sun, 14 Jan 2018 06:02:04 -0500 Received: by mail-pf0-f180.google.com with SMTP id e11so6823387pff.6 for <30073@debbugs.gnu.org>; Sun, 14 Jan 2018 03:02:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version:content-transfer-encoding; bh=kUBXd4ZS6yU4/PLf5RvOWJN9X95Y6ZAvzl397dxNhxg=; b=k/r/ve8jGcyZVRWui3U6uEMnJacrJiGmyz5Q/SKDVBcaZO3jcPdlccIUej6aCo5dz8 MOxour8DNfFzwl9ZrfisMG0YGsgJcwfmT3PIuMyDePSHxkBwnhxFTCHRQTDZ3kR//m2p 20Ffde2yKkV9QEkcL/xO63U+S4dfYdXgGRzjGsC+Kn/jR/uvKeDMkaIhJZ0HY9i9F4hP wa6eOnS+ImIKwSIUY8fXCTSvur0NpMMlpBD8/By3W4uBIwFdcvo6rYLihUxXDGv0258u LeRo6Vpkf+tmZbAteBe/9RAH+pe39VVXOXnDMUZ4D0KPfc9Q4gBHA3OavhUwKzmnCCTZ 3CYw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version:content-transfer-encoding; bh=kUBXd4ZS6yU4/PLf5RvOWJN9X95Y6ZAvzl397dxNhxg=; b=p5WVWe3lUQm50QZb7yHM3ORY4+18OXY4/6RCr1cAiT9ot+1/GexUAvuQlaUjhCBZDn hZom/JhSVukhEXg34+N6jYxGmfiVL/N1iZHZr++CEJrDErsOfjAmWcnqTmekbnmY7Ce8 CWreSfSewtxzCCmLwWAKZzhGjEtpOuXaI2qIfdzOYJdGICLO++LRASrF8gjYvemMJmXr k2R9vpgGTfUcKair71Eo3hSfbi8FiUeZK0DLJKBJ10UpELPjRN5dVdzEnL0X+H+9o2D4 v99jHG1MTFXwCnUsju1VhDpF1pxVtdyZMeyF6Bhjhd6Mn8r5TjzqamsOmSSlna12skAC G+fg== X-Gm-Message-State: AKGB3mKVPLVKZ75zkyvIyxYqbK6jwi15dJrPgmc6AmhrZIiOxVZyGmzd PRxC9L3LRxAXe4kBWDvCEYDEkA== X-Google-Smtp-Source: ACJfBovsXLEbIhRnJYej531iqlmMXyqbguVaYxMiDGQqnj17+LfnPDLevEo96lJUGTp6t/bgY8quyw== X-Received: by 10.98.4.1 with SMTP id 1mr28446961pfe.19.1515927717579; Sun, 14 Jan 2018 03:01:57 -0800 (PST) Received: from calancha-pc (155.7.236.133.dy.bbexcite.jp. [133.236.7.155]) by smtp.gmail.com with ESMTPSA id v15sm57821266pfa.68.2018.01.14.03.01.55 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Jan 2018 03:01:57 -0800 (PST) From: Tino Calancha References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> Date: Sun, 14 Jan 2018 20:01:50 +0900 In-Reply-To: <87y3l1e68y.fsf@mail.linkov.net> (Juri Linkov's message of "Sun, 14 Jan 2018 00:38:15 +0200") Message-ID: <871sis66w1.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) Juri Linkov writes: >>> What is worse, it doesn't work at all - setting dired-deletion-confirmer >>> to y-or-n-p has no effect on the question =E2=80=9CRecursively delete .= ..? =E2=80=9D. >>> It still expects =E2=80=9C[yes, no, all, quit, help]=E2=80=9D answers, = not short ones >>> like =E2=80=9Cy/n/!/q/?=E2=80=9D. >> >> If you want to use y-or-n-p there, you will have to replace >> dired--yes-no-all-quit-help with your own function. > > Thanks for the idea. Here is the first version of its implementation: Thank you for the patch. I like it. Is OK if we add docstring to those vars? -(defvar dired-recursive-deletion-confirmer 'dired--yes-no-all-quit-help) ;= ; or 'dired--y-n-!-q-? +(defvar dired-recursive-deletion-confirmer 'dired--yes-no-all-quit-help ; = or 'dired--y-n-!-q-? + "Function for asking user confirmation to delete directories recursively. +Set it to `dired--y-n-!-q-?' if you prefer reply shortly.") =20 -(defvar dired-deletion-confirmer 'yes-or-no-p) ; or y-or-n-p? +(defvar dired-deletion-confirmer 'yes-or-no-p ; or y-or-n-p? + "Function for asking user confirmation to delete files. +Set it to `y-or-n-p' if you prefer reply shorty.") From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 14 Jan 2018 23:40:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Tino Calancha Cc: contovob@tcd.ie, Eli Zaretskii , 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151597315118120 (code B ref 30073); Sun, 14 Jan 2018 23:40:01 +0000 Received: (at 30073) by debbugs.gnu.org; 14 Jan 2018 23:39:11 +0000 Received: from localhost ([127.0.0.1]:56467 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1earrr-0004iC-7Y for submit@debbugs.gnu.org; Sun, 14 Jan 2018 18:39:11 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:46592 helo=homiemail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1earrp-0004i4-2S for 30073@debbugs.gnu.org; Sun, 14 Jan 2018 18:39:09 -0500 Received: from homiemail-a17.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTP id D42D02B206A; Sun, 14 Jan 2018 15:39:07 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPSA id 429002B2065; Sun, 14 Jan 2018 15:39:06 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> Date: Mon, 15 Jan 2018 00:53:45 +0200 In-Reply-To: <871sis66w1.fsf@gmail.com> (Tino Calancha's message of "Sun, 14 Jan 2018 20:01:50 +0900") Message-ID: <874lno10di.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Thanks for the idea. Here is the first version of its implementation: > Thank you for the patch. I like it. But I don't like it :-) Neither (fset 'yes-or-no-p 'y-or-n-p) nor (advice-add 'yes-or-no-p :override #'y-or-n-p) are good methods of customization, so dired-deletion-confirmer and dired-recursive-deletion-confirmer are equally bad. What I'm thinking about is introducing a boolean customizable variable that would define whether abbreviated answers are preferred by the user. Then a new minibuffer-reading function could accept a list of abbreviatio= ns and map them to long full answers. Something like =E2=80=98read-multiple-choice=E2=80=99 or =E2=80=98map-y-o= r-n-p=E2=80=99, but that would allow either long or short answers depending on customization like =E2=80=98rmail-confirm-expunge=E2=80=99, =E2=80=98url-confirmation-f= unc=E2=80=99, =E2=80=98org-confirm-shell-link-function=E2=80=99, =E2=80=98org-confirm-e= lisp-link-function=E2=80=99, or on its argument like =E2=80=98strong-query=E2=80=99 in =E2=80=98custom= -command-apply=E2=80=99. WDYT? diff --git a/lisp/dired.el b/lisp/dired.el index b853d64..0ce24d0 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -3005,27 +3006,60 @@ dired-delete-help `quit' to exit, `help' to show this help message.") =20 -(defun dired--yes-no-all-quit-help (prompt &optional help-msg) - "Ask a question with valid answers: yes, no, all, quit, help. -PROMPT must end with '? ', for instance, 'Delete it? '. -If optional arg HELP-MSG is non-nil, then is a message to show when -the user answers 'help'. Otherwise, default to `dired-delete-help'." - (let ((valid-answers (list "yes" "no" "all" "quit")) - (answer "") - (input-fn (lambda () - (read-string - (format "%s [yes, no, all, quit, help] " prompt))))) - (setq answer (funcall input-fn)) - (when (string=3D answer "help") - (with-help-window "*Help*" - (with-current-buffer "*Help*" - (insert (or help-msg dired-delete-help))))) - (while (not (member answer valid-answers)) - (unless (string=3D answer "help") +(defcustom read-answers-short nil + "If non-nil, accept short answers to the question." + :version "27.1" + :type 'boolean) + +(defun read-answers (prompt answers &optional help-msg short) + (let* ((short (or short read-answers-short)) + (prompt (format "%s [%s] " prompt + (mapconcat (lambda (a) + (if short (cadr a) (car a))) + answers ", "))) + (message (format "Please answer %s" + (mapconcat (lambda (a) + (format "`%s'" (if short (cadr a)= (car a)))) + answers " or "))) + (short-answer-map (when short + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-m= ap) + (dolist (answer read-short-answers) + (define-key map (car answer) + (lambda () + (interactive) + (delete-minibuffer-contents) + (insert (cadr answer)) + (exit-minibuffer)))) + (define-key map [remap self-insert-comman= d] + (lambda () + (interactive) + (delete-minibuffer-contents) + (beep) + (message message) + (sleep-for 2))) + map))) + answer) + (while (not (assoc (setq answer + (if short + (read-from-minibuffer + prompt nil short-answer-map) + (read-string prompt))) + answers)) + (if (and (string=3D answer "help") (stringp help-msg)) + (with-help-window "*Help*" + (with-current-buffer "*Help*" + (insert (if short + (seq-reduce (lambda (msg a) + (replace-regexp-in-string + (format "`%s'" (car a)) + (format "`%s'" (cadr a)) + msg nil t)) + answers help-msg) + help-msg)))) (beep) - (message "Please answer `yes' or `no' or `all' or `quit'") - (sleep-for 2)) - (setq answer (funcall input-fn))) + (message message) + (sleep-for 2))) answer)) =20 ;; Delete file, possibly delete a directory and all its files. @@ -3057,11 +3091,16 @@ dired-delete-file "trash" "delete") (dired-make-relative file)))) - (pcase (dired--yes-no-all-quit-help prompt) ; Prompt = user. + (pcase (read-answers prompt '(("yes" "y") + ("no" "n") + ("all" "!") + ("quit" "q")) + dired-delete-help) ('"all" (setq recursive 'always dired-recursive-del= etes recursive)) ('"yes" (if (eq recursive 'top) (setq recursive 'al= ways))) ('"no" (setq recursive nil)) - ('"quit" (keyboard-quit))))) + ('"quit" (keyboard-quit)) + (_ (keyboard-quit))))) ; catch all unknown answers (setq recursive nil)) ; Empty dir or recursive is nil. (delete-directory file recursive trash)))) =20 From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jan 2018 05:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151599358830593 (code B ref 30073); Mon, 15 Jan 2018 05:20:01 +0000 Received: (at 30073) by debbugs.gnu.org; 15 Jan 2018 05:19:48 +0000 Received: from localhost ([127.0.0.1]:56596 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaxBU-0007xM-Hf for submit@debbugs.gnu.org; Mon, 15 Jan 2018 00:19:48 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56013) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eaxBS-0007x6-VD for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 00:19:47 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eaxBK-0001LP-Lo for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 00:19:41 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:42301) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eaxBK-0001LD-I3; Mon, 15 Jan 2018 00:19:38 -0500 Received: from [176.228.60.248] (port=3420 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eaxBJ-0006Da-Ru; Mon, 15 Jan 2018 00:19:38 -0500 Date: Mon, 15 Jan 2018 07:19:24 +0200 Message-Id: <83k1wjzokj.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <874lno10di.fsf@mail.linkov.net> (message from Juri Linkov on Mon, 15 Jan 2018 00:53:45 +0200) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Cc: Eli Zaretskii , contovob@tcd.ie, 30073@debbugs.gnu.org > Date: Mon, 15 Jan 2018 00:53:45 +0200 > > What I'm thinking about is introducing a boolean customizable variable > that would define whether abbreviated answers are preferred by the user. > Then a new minibuffer-reading function could accept a list of abbreviations > and map them to long full answers. > > Something like ‘read-multiple-choice’ or ‘map-y-or-n-p’, but that > would allow either long or short answers depending on customization > like ‘rmail-confirm-expunge’, ‘url-confirmation-func’, > ‘org-confirm-shell-link-function’, ‘org-confirm-elisp-link-function’, > or on its argument like ‘strong-query’ in ‘custom-command-apply’. > > WDYT? Why limit this to Dired? People who use fset to get y-or-n-p want that everywhere, right? From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jan 2018 17:02:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov , Tino Calancha Cc: contovob@tcd.ie, 30073@debbugs.gnu.org Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15160357021506 (code B ref 30073); Mon, 15 Jan 2018 17:02:01 +0000 Received: (at 30073) by debbugs.gnu.org; 15 Jan 2018 17:01:42 +0000 Received: from localhost ([127.0.0.1]:57711 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eb88j-0000Nt-EX for submit@debbugs.gnu.org; Mon, 15 Jan 2018 12:01:41 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:50738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eb88g-0000GG-QZ for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 12:01:39 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0FGvM7J013119; Mon, 15 Jan 2018 17:01:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=CuB7lcQuxpSjql6tYMcWmUwqLVATXj6x5g4hvRJB8S8=; b=lbmo/ZfzsJC28zCIXOpN7rCSzHC4HnuxcebFA7s+TWUqXfPRdQN99APu1VqTnKtOC6eP HbnkqWTXBGP8DCYp7PRG65tKqoCS4IGzz8JbLDHps1Fk+/OsPGMMzkpTt+/Bf/MvH7Qe f2k7Y84+Ko0iPFfoFR+5FwYy0NNX90E/SiEYNQ7/m1oGr+oyjwR9dcYwFmIwqHzHMwYM pMr2prfYT/icloZf0m50GA8XHymZ+Tkv3I9QmgexEJxDqvUb/2JFVo3ITrmJMZ2iCOVt H6o56PEugGmnzNK97tbdcJaGvojgGjj0QEQoSlOz+Jixh1YhZ+ZLltIm+44uCBxSxni+ sg== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2fgy9ng92t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 15 Jan 2018 17:01:29 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0FH1SwG003431 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 15 Jan 2018 17:01:28 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0FH1QbD032659; Mon, 15 Jan 2018 17:01:26 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 15 Jan 2018 09:01:24 -0800 (PST) From: Drew Adams References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> In-Reply-To: <874lno10di.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4627.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8775 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801150240 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Neither (fset 'yes-or-no-p 'y-or-n-p) nor > (advice-add 'yes-or-no-p :override #'y-or-n-p) > are good methods of customization, so dired-deletion-confirmer > and dired-recursive-deletion-confirmer are equally bad. >=20 > What I'm thinking about is introducing a boolean customizable variable > that would define whether abbreviated answers are preferred by the user. > Then a new minibuffer-reading function could accept a list of > abbreviations and map them to long full answers. >=20 > Something like =E2=80=98read-multiple-choice=E2=80=99 or =E2=80=98map-y-o= r-n-p=E2=80=99, but that > would allow either long or short answers depending on customization > like =E2=80=98rmail-confirm-expunge=E2=80=99, =E2=80=98url-confirmation-f= unc=E2=80=99, > =E2=80=98org-confirm-shell-link-function=E2=80=99, =E2=80=98org-confirm-e= lisp-link-function=E2=80=99, > or on its argument like =E2=80=98strong-query=E2=80=99 in =E2=80=98custom= -command-apply=E2=80=99. >=20 > WDYT? (I haven't been following this thread. Apologies if I misunderstand/misspeak.) First, why is this being discussed (only) in the context of Dired? Isn't this something to consider more generally? Do we all agree on the following points? 1. Users advising the yes/no confirmation-prompt functions is not a good solution to users wanting to sometimes (or always) use a different prompting approach from the one chosen by the author of the code that prompts. 2. Choosing a single prompt approach (e.g. `y-or-n-p' or `yes-or-no-p') for all contexts might be appropriate for some users, but it is probably not a great idea in general. 3. Even a given user might appreciate that a given prompting context asks them using the slow approach (`yes-or-no-p') at first, or most of the time, but she might sometimes, or even generally after some experience, prefer that that prompting context use a faster approach (e.g. `y-or-n-p'). IOW, it would be good for a user to be able to easily specify anytime, for a given prompting context, which prompting approach to use. An code author chooses which confirmation-prompting approach s?he thinks is most appropriate for most users in a given context. Typically, contexts where the wrong answer can have graver consequences get the `yes-or-no-p' approach. IIUC, this bug discussion is looking into the possibility of giving users a simple way to choose one or the other approach generally, i.e., for use everywhere, or at least everywhere within some overall context (e.g. Dired). Is that right? If so, that responds to #1 above, but not to #2 (or #3). Along those lines, instead of a Boolean value for a user option, to choose one or the other approach everywhere, perhaps an alist value would be good, with the alist entries (somehow) characterizing the prompting approach to use for different contexts (defined how?). Even so, though helpful, that would not really be a good response to #3 above. ______ I've proposed the following before, but I'll mention it again. It doesn't respond to #1 or #2, so it is likely complementary to what I think you're proposing, which is a user option to choose generally, as an alternative to advising. That is, it could be complementary. The first thing needed here is for confirmation-prompting functions to be able to (and preferably to do it) specify the current context in which they are called. That will give users a way to specify what they want for a particular such context. A start in that direction is to provide to the prompting function the name of the function that is calling it. No, that won't distinguish particular calls (occurrences). But it will be a good start. For example, if `y-or-n-p' is called from function `foo', and if the call records that fact, then a user can specify that all `y-or-n-p' calls from `foo' should be handled as if they were `yes-or-no-p' calls. This means adding an optional argument to `y-or-n-p' and `yes-or-no-p' (and other confirmation-prompting functions). If function `foo' wants to give a user control then it would use `(y-or-n-p "Do you agree? " 'foo)' instead of just `(y-or-n-p "Do you agree? ")'. Likewise, for `yes-or-no-p'. That's the only change needed, to give users control here. I've implemented this in library `yes-no.el'. I think it's a good start. Combined with a user option as discussed above, and overriding the option's more general behavior, it could offer quite a lot of user control unobtrusively and straightforwardly. `yes-no.el' works by allowing, besides the y/n and yes/no responses, a response that says "Switch to using the other prompting method from now on". It thus lets users change the prompting function interactively for the given calling function. In addition or alternatively, users can specify such preferences using a user option. Specifying behavior interactively updates the option value and saves it. IOW, interactive specification is an on-the-fly shortcut to using Customize. Rather than describe here just what it does and how, I invite you to have a look at the Commentary or code of the library, if you're interested. But the easiest way to see what it does is just to try it. https://www.emacswiki.org/emacs/download/yes-no.el I think it responds to the twin needs for (1) code author being able to judge which behavior is preferable for most users most of the time and (2) user being able to change the behavior anytime. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jan 2018 23:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151605919729467 (code B ref 30073); Mon, 15 Jan 2018 23:34:02 +0000 Received: (at 30073) by debbugs.gnu.org; 15 Jan 2018 23:33:17 +0000 Received: from localhost ([127.0.0.1]:57878 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebEFh-0007fC-Ie for submit@debbugs.gnu.org; Mon, 15 Jan 2018 18:33:17 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:49664 helo=homiemail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebEFg-0007f4-6u for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 18:33:16 -0500 Received: from homiemail-a17.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTP id 2A4382B206A; Mon, 15 Jan 2018 15:33:15 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPSA id CAB722B2065; Mon, 15 Jan 2018 15:33:13 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <83k1wjzokj.fsf@gnu.org> Date: Tue, 16 Jan 2018 01:02:27 +0200 In-Reply-To: <83k1wjzokj.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 15 Jan 2018 07:19:24 +0200") Message-ID: <87efmqaeea.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> What I'm thinking about is introducing a boolean customizable variable >> that would define whether abbreviated answers are preferred by the use= r. >> Then a new minibuffer-reading function could accept a list of abbrevia= tions >> and map them to long full answers. >> >> Something like =E2=80=98read-multiple-choice=E2=80=99 or =E2=80=98map-= y-or-n-p=E2=80=99, but that >> would allow either long or short answers depending on customization >> like =E2=80=98rmail-confirm-expunge=E2=80=99, =E2=80=98url-confirmatio= n-func=E2=80=99, >> =E2=80=98org-confirm-shell-link-function=E2=80=99, =E2=80=98org-confir= m-elisp-link-function=E2=80=99, >> or on its argument like =E2=80=98strong-query=E2=80=99 in =E2=80=98cus= tom-command-apply=E2=80=99. >> >> WDYT? > > Why limit this to Dired? People who use fset to get y-or-n-p want > that everywhere, right? Right, this is not specific to Dired. So we could add a new customizable variable, and easily change =E2=80=98yes-or-no-p=E2=80=99 to= call =E2=80=98y-or-n-p=E2=80=99 if it's non-nil. Oh, wait, not so easily, I see that =E2=80=98yes-or-no-p=E2=80=99 is implemented in C. Is there a particular reason why it's not in Lisp? In any case this would be better customization to choose between =E2=80=9Cyes/no=E2=80=9D and =E2=80=9Cy/n=E2=80=9D. Regarding a new mult= iple options reading function =E2=80=98read-answer=E2=80=99, I'm not sure where to put it. There is a = separate file map-ynp.el for a single function =E2=80=98map-y-or-n-p=E2=80=99, and a se= parate file rmc.el for a single function =E2=80=98read-multiple-choice=E2=80=99. But= I hesitate to do the same and create a new file for just one function. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 15 Jan 2018 23:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Drew Adams Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, Tino Calancha Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151605920229489 (code B ref 30073); Mon, 15 Jan 2018 23:34:02 +0000 Received: (at 30073) by debbugs.gnu.org; 15 Jan 2018 23:33:22 +0000 Received: from localhost ([127.0.0.1]:57881 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebEFl-0007fZ-Px for submit@debbugs.gnu.org; Mon, 15 Jan 2018 18:33:21 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:57410 helo=homiemail-a17.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebEFj-0007fR-MC for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 18:33:19 -0500 Received: from homiemail-a17.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTP id 2C03C2B206E; Mon, 15 Jan 2018 15:33:19 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a17.g.dreamhost.com (Postfix) with ESMTPSA id D669C2B2065; Mon, 15 Jan 2018 15:33:17 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> Date: Tue, 16 Jan 2018 01:13:04 +0200 In-Reply-To: (Drew Adams's message of "Mon, 15 Jan 2018 09:01:24 -0800 (PST)") Message-ID: <87d12aaedz.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Do we all agree on the following points? > > 1. Users advising the yes/no confirmation-prompt functions > is not a good solution to users wanting to sometimes (or > always) use a different prompting approach from the one > chosen by the author of the code that prompts. I agree that advising the yes/no confirmation is not good from a customization standpoint. > 2. Choosing a single prompt approach (e.g. `y-or-n-p' or > `yes-or-no-p') for all contexts might be appropriate for > some users, but it is probably not a great idea in general. Please see an optional argument =E2=80=98short=E2=80=99 that I added to m= y previous patch. It will allow using short answers even when customizable variable is nil where code authors deem appropriate. > 3. Even a given user might appreciate that a given prompting > context asks them using the slow approach (`yes-or-no-p') > at first, or most of the time, but she might sometimes, > or even generally after some experience, prefer that that > prompting context use a faster approach (e.g. `y-or-n-p'). I'm not sure if we need more fine-grained customization. If the user decides that a short answer is enough, enough is enough. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2018 00:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, Tino Calancha Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15160637153456 (code B ref 30073); Tue, 16 Jan 2018 00:49:02 +0000 Received: (at 30073) by debbugs.gnu.org; 16 Jan 2018 00:48:35 +0000 Received: from localhost ([127.0.0.1]:57903 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebFQY-0000tg-U5 for submit@debbugs.gnu.org; Mon, 15 Jan 2018 19:48:35 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:36202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebFQX-0000tQ-1V for 30073@debbugs.gnu.org; Mon, 15 Jan 2018 19:48:33 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0G0kvK6157819; Tue, 16 Jan 2018 00:48:17 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=0feGZYMSt7rfBwT4hFK10GRZMUSEsoDBSWWM0Q0sitg=; b=arq/FjoVknMH/m+iSv+zBxqJe54hqHm4qOPW0Fxtv9zjI0WEZmZxKIV563xD/I4PLaZx IEKYt5EbKDQK79K2Y7NOh34oJ7Odl7BCWGrQkF86ChwdgZ1bXebi5mVTbZLp5EW557T3 4TbvmKxeprt3qhPrQyL5+TeSKPbsM1EjcW0KAse78z0FeX76WeuywIbYGoNVDBGrRFpl x2oGqKEvNJ42r8GMykXBlW+XAqGctr8PivjSGkr7oEhh/DiS/RwMwJYEKEnfo6jfYIlS fylLnBgq6g5OIslWmuGyeoQ+cSm6IuHO2NBxhNsxcAHjvPnOj8MH9ojMCdFUyXSRgS54 Gw== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2120.oracle.com with ESMTP id 2fh701r0km-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 16 Jan 2018 00:48:17 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0G0mHbt029758 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 16 Jan 2018 00:48:17 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w0G0mGGG030666; Tue, 16 Jan 2018 00:48:16 GMT MIME-Version: 1.0 Message-ID: Date: Mon, 15 Jan 2018 16:48:15 -0800 (PST) From: Drew Adams References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> In-Reply-To: <87d12aaedz.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4627.0 (x86)] Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8775 signatures=668652 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801160009 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > I agree that advising the yes/no confirmation is not good > from a customization standpoint. >=20 >> 2. Choosing a single prompt approach (e.g. `y-or-n-p' or >> `yes-or-no-p') for all contexts might be appropriate for >> some users, but it is probably not a great idea in general. >=20 > Please see an optional argument =E2=80=98short=E2=80=99 that I added to m= y previous > patch. It will allow using short answers even when customizable > variable is nil where code authors deem appropriate. I saw it. That's not the problem to solve, IMO. It's not just about giving users a cleaner way to get `y-or-n-p' behavior globally, in place of advising `yes-or-no-p'. (I think/hope you agree with that much.) But it's also not about letting code authors decide which to use, even by overriding a user's preference. There's no need for that at all, AFAICS. Authors can already get "short" behavior anytime they want, and overriding a user setting that way would not be helpful. You're solving the wrong problem, I think. It's not only about moving from long to short. A user can want to go the other way too. And it's definitely not just about a systematic move in one direction or the other. Just as each _author_ can (and does) decide, for any given context, which kind of confirmation prompting to use, so can a _user_ make her own judgment about that. We're just not giving her a way to do that, today. We don't provide library authors with just a binary choice: ALL of your confirmation prompts must be long or ALL of them must be short. That would be silly. For the exact same reasons we should allow _users_ the same possibilities to judge and decide what behavior they want here and there. An author gets to decide that; so should users - a fortiori. We just need to provide an easy-to-use way to choose. That's what I've tried to do with `yes-no.el'. Other approaches to solving that problem are possible. But that's the problem to solve, IMO. Not just providing a substitute for advising - another way to give users an all-or-nothing choice. And not giving authors a way to override a user's choice. Users are different. They have different degrees of familiarity with Emacs and different degrees of confidence about the use of this or that part of Emacs. And those things can and do change over time. The first time you use an operation that deletes a file you might well want it to make you confirm slowly. After using it 1000 times you might want it to let you just hit `y'. Or not. >> 3. Even a given user might appreciate that a given prompting >> context asks them using the slow approach (`yes-or-no-p') >> at first, or most of the time, but she might sometimes, >> or even generally after some experience, prefer that that >> prompting context use a faster approach (e.g. `y-or-n-p'). >=20 > I'm not sure if we need more fine-grained customization. > If the user decides that a short answer is enough, enough is > enough. I disagree. It's not about just a general movement, everywhere from `yes-or-no-p' to `y-or-n-p'. It's about the particular user and the particular context. A given library might (from a given user's point of view) inappropriately use one or the other approach. It might use `yes-or-no-p' behavior everywhere, annoying many users. Or it might inappropriately use `y-or-n-p' behavior everywhere. There is nothing that guarantees a match between an author's idea of what is best overall and a user's idea of what is best for her in a given context at a given time. Did you try `yes-no.el'? The implementation and use are pretty simple - not a big deal. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 16 Jan 2018 17:58:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15161254305929 (code B ref 30073); Tue, 16 Jan 2018 17:58:02 +0000 Received: (at 30073) by debbugs.gnu.org; 16 Jan 2018 17:57:10 +0000 Received: from localhost ([127.0.0.1]:59013 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebVTy-0001XZ-7D for submit@debbugs.gnu.org; Tue, 16 Jan 2018 12:57:10 -0500 Received: from eggs.gnu.org ([208.118.235.92]:56654) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebVTu-0001X2-CJ for 30073@debbugs.gnu.org; Tue, 16 Jan 2018 12:57:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ebVTl-0006iK-A5 for 30073@debbugs.gnu.org; Tue, 16 Jan 2018 12:57:01 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_40,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:45066) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ebVTl-0006iF-6J; Tue, 16 Jan 2018 12:56:57 -0500 Received: from [176.228.60.248] (port=1661 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ebVTk-0007KE-Kg; Tue, 16 Jan 2018 12:56:57 -0500 Date: Tue, 16 Jan 2018 19:56:47 +0200 Message-Id: <83a7xdy9eo.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87efmqaeea.fsf@mail.linkov.net> (message from Juri Linkov on Tue, 16 Jan 2018 01:02:27 +0200) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <83k1wjzokj.fsf@gnu.org> <87efmqaeea.fsf@mail.linkov.net> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Cc: tino.calancha@gmail.com, contovob@tcd.ie, 30073@debbugs.gnu.org > Date: Tue, 16 Jan 2018 01:02:27 +0200 > > > Why limit this to Dired? People who use fset to get y-or-n-p want > > that everywhere, right? > > Right, this is not specific to Dired. So we could add a new > customizable variable, and easily change ‘yes-or-no-p’ to call > ‘y-or-n-p’ if it's non-nil. Oh, wait, not so easily, > I see that ‘yes-or-no-p’ is implemented in C. Why is that a problem? C code can access Lisp variables and can call Lips functions. > Is there a particular reason why it's not in Lisp? Probably history, coupled with the fact that a few things it does are easier done in C. > In any case this would be better customization to choose between > “yes/no” and “y/n”. Why better? > Regarding a new multiple options reading function ‘read-answer’, I'm > not sure where to put it. How many callers does it have now, and which callers are those? From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2018 23:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Drew Adams Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, Tino Calancha Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15162311866317 (code B ref 30073); Wed, 17 Jan 2018 23:20:02 +0000 Received: (at 30073) by debbugs.gnu.org; 17 Jan 2018 23:19:46 +0000 Received: from localhost ([127.0.0.1]:60691 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebwzh-0001dp-Tr for submit@debbugs.gnu.org; Wed, 17 Jan 2018 18:19:46 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:59743 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebwzf-0001dh-Cr for 30073@debbugs.gnu.org; Wed, 17 Jan 2018 18:19:43 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 9010731A073; Wed, 17 Jan 2018 15:19:42 -0800 (PST) Received: from localhost.linkov.net (m91-129-98-183.cust.tele2.ee [91.129.98.183]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id 44D4831A070; Wed, 17 Jan 2018 15:19:41 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> Date: Thu, 18 Jan 2018 00:03:04 +0200 In-Reply-To: (Drew Adams's message of "Mon, 15 Jan 2018 16:48:15 -0800 (PST)") Message-ID: <8737345cy3.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > We just need to provide an easy-to-use way to choose. I agree that better customization for yes/no questions would be nice to have, we could create a separate feature request for that. But what I'm addressing here in bug#30073 is a regression. A question for deletions in Dired used to respect user configuration for accepting short answers, but now it always requires typing long answers. This is very annoying. I'll post a new patch shortly to finally fix this issue. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 17 Jan 2018 23:20:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15162311896334 (code B ref 30073); Wed, 17 Jan 2018 23:20:02 +0000 Received: (at 30073) by debbugs.gnu.org; 17 Jan 2018 23:19:49 +0000 Received: from localhost ([127.0.0.1]:60694 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebwzl-0001e6-4v for submit@debbugs.gnu.org; Wed, 17 Jan 2018 18:19:49 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:59750 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ebwzj-0001dy-LN for 30073@debbugs.gnu.org; Wed, 17 Jan 2018 18:19:48 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 2DA4631A073; Wed, 17 Jan 2018 15:19:47 -0800 (PST) Received: from localhost.linkov.net (m91-129-98-183.cust.tele2.ee [91.129.98.183]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id 60B5231A070; Wed, 17 Jan 2018 15:19:45 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <83k1wjzokj.fsf@gnu.org> <87efmqaeea.fsf@mail.linkov.net> <83a7xdy9eo.fsf@gnu.org> Date: Thu, 18 Jan 2018 00:56:57 +0200 In-Reply-To: <83a7xdy9eo.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 16 Jan 2018 19:56:47 +0200") Message-ID: <87inc0yt1y.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) >> Regarding a new multiple options reading function =E2=80=98read-answer= =E2=80=99, I'm >> not sure where to put it. > > How many callers does it have now, and which callers are those? Currently it will have just one caller in =E2=80=98dired-delete-file=E2=80= =99, but it's possible to gradually replace all callers that are using =E2=80=98yes-or-no-p=E2=80=99 and =E2=80=98y-or-n-p=E2=80=99 with equival= ent calls of =E2=80=98read-answer=E2=80=99 with the argument '(("yes" ?y) ("no" ?n)) that will accept either long or short answer depending on the new customizable variable. In this patch I placed new code to map-ynp.el because in loadup.el "emacs-lisp/map-ynp" is loaded immediately after loading "custom", so map-ynp.el is the first file that allows using defcustom. Most importantly, a new function is logically related to map-y-or-n-p, and grouping related functions in one file is much better than polluting file namespace with separate files such as map-ynp.el, rmc.el, crm.el... diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index 2a7edde..85ed9e0 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -256,4 +256,86 @@ map-y-or-n-p ;; Return the number of actions that were taken. actions)) =20 +=0C +;; For backward compatibility check if short y/n answers are preferred. +(defcustom read-answer-short (eq (symbol-function 'yes-or-no-p) 'y-or-n-= p) + "If non-nil, accept short answers to the question." + :type 'boolean + :version "27.1" + :group 'minibuffer) + +(defun read-answer (question answers) + "Read an answer either as a complete word or its character abbreviatio= n. +Ask QUESTION and accept an answer from the list of possible ANSWERS. +This list contains lists in the following format: + (LONG-ANSWER SHORT-ANSWER HELP-MESSAGE) +where + LONG-ANSWER is a complete answer, + SHORT-ANSWER is an abbreviated one-letter answer, + HELP-MESSAGE is a string describing the meaning of the answer. + +Example: + '((\"yes\" ?y \"perform the action\") + (\"no\" ?n \"skip to the next\") + (\"all\" ?! \"accept all remaining without more questions\") + (\"quit\" ?q \"exit\")) + +When `read-answer-short' is non-nil, accept short answers. + +Return a long answer even in case of accepting short ones." + (custom-reevaluate-setting 'read-answer-short) + (let* ((short read-answer-short) + (answers-with-help (append answers '(("help" ?? "show this help= message")))) + (prompt (format "%s(%s) " question + (mapconcat (lambda (a) + (if short (format "%c=3D%s" (nth 1= a) (nth 0 a)) (nth 0 a))) + answers-with-help ", "))) + (message (format "Please answer %s." + (mapconcat (lambda (a) + (format "`%s'" (if short (string = (nth 1 a)) (nth 0 a)))) + answers-with-help " or "))) + (short-answer-map (when short + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-m= ap) + (dolist (answer answers-with-help) + (define-key map (vector (nth 1 answer)) + (lambda () + (interactive) + (delete-minibuffer-contents) + (insert (nth 0 answer)) + (exit-minibuffer)))) + (define-key map [remap self-insert-comman= d] + (lambda () + (interactive) + (delete-minibuffer-contents) + (beep) + (message message) + (sleep-for 2))) + map))) + answer) + (while (not (assoc (setq answer (cond (short + (read-from-minibuffer + prompt nil short-answer-map)= ) + (t + (read-from-minibuffer + prompt nil nil nil + 'yes-or-no-p-history)))) + answers)) + (if (string=3D answer "help") + (with-help-window "*Help*" + (with-current-buffer "*Help*" + (insert "Type:\n" + (mapconcat (lambda (a) + (format "`%s' to %s" + (if short + (format "%c (%s)" (nth 1 = a) (nth 0 a)) + (nth 0 a)) + (nth 2 a))) + answers-with-help ",\n") + ".\n"))) + (beep) + (message message) + (sleep-for 2))) + answer)) + ;;; map-ynp.el ends here diff --git a/lisp/dired.el b/lisp/dired.el index b853d64..9a412d0 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2997,37 +2998,6 @@ dired-recursive-deletes ;; Match anything but `.' and `..'. (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") =20 -(defconst dired-delete-help - "Type: -`yes' to delete recursively the current directory, -`no' to skip to next, -`all' to delete all remaining directories with no more questions, -`quit' to exit, -`help' to show this help message.") - -(defun dired--yes-no-all-quit-help (prompt &optional help-msg) - "Ask a question with valid answers: yes, no, all, quit, help. -PROMPT must end with '? ', for instance, 'Delete it? '. -If optional arg HELP-MSG is non-nil, then is a message to show when -the user answers 'help'. Otherwise, default to `dired-delete-help'." - (let ((valid-answers (list "yes" "no" "all" "quit")) - (answer "") - (input-fn (lambda () - (read-string - (format "%s [yes, no, all, quit, help] " prompt))))) - (setq answer (funcall input-fn)) - (when (string=3D answer "help") - (with-help-window "*Help*" - (with-current-buffer "*Help*" - (insert (or help-msg dired-delete-help))))) - (while (not (member answer valid-answers)) - (unless (string=3D answer "help") - (beep) - (message "Please answer `yes' or `no' or `all' or `quit'") - (sleep-for 2)) - (setq answer (funcall input-fn))) - answer)) - ;; Delete file, possibly delete a directory and all its files. ;; This function is useful outside of dired. One could change its name ;; to e.g. recursive-delete-file and put it somewhere else. @@ -3057,11 +3027,17 @@ dired-delete-file "trash" "delete") (dired-make-relative file)))) - (pcase (dired--yes-no-all-quit-help prompt) ; Prompt = user. + (pcase (read-answer + prompt + '(("yes" ?y "delete recursively the current = directory") + ("no" ?n "skip to next") + ("all" ?! "delete all remaining directorie= s with no more questions") + ("quit" ?q "exit"))) ('"all" (setq recursive 'always dired-recursive-del= etes recursive)) ('"yes" (if (eq recursive 'top) (setq recursive 'al= ways))) ('"no" (setq recursive nil)) - ('"quit" (keyboard-quit))))) + ('"quit" (keyboard-quit)) + (_ (keyboard-quit))))) ; catch all unknown answers (setq recursive nil)) ; Empty dir or recursive is nil. (delete-directory file recursive trash)))) =20 diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index c024213..bb0e1bc 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -384,9 +384,9 @@ dired-test-with-temp-dirs (dired-test-with-temp-dirs 'just-empty-dirs (let (asked) - (advice-add 'dired--yes-no-all-quit-help + (advice-add 'read-answer :override - (lambda (_) (setq asked t) "") + (lambda (_q _a) (setq asked t) "") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -395,44 +395,44 @@ dired-test-with-temp-dirs (progn (should-not asked) (should-not (dired-get-marked-files))) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-= advice)))) + (advice-remove 'read-answer 'dired-test-bug27940-advice)))) ;; Answer yes (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "yes") + (advice-add 'read-answer :override (lambda (_q _a) "yes") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should-not (dired-get-marked-files)) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-ad= vice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer no (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "no") + (advice-add 'read-answer :override (lambda (_q _a) "no") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should (=3D 5 (length (dired-get-marked-files)))) ; Just the emp= ty dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-ad= vice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer all (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "all") + (advice-add 'read-answer :override (lambda (_q _a) "all") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should-not (dired-get-marked-files)) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-ad= vice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer quit (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "quit"= ) + (advice-add 'read-answer :override (lambda (_q _a) "quit") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -440,7 +440,7 @@ dired-test-with-temp-dirs (dired-do-delete nil)) (unwind-protect (should (=3D 6 (length (dired-get-marked-files)))) ; All empty di= rs but zeta-empty-dir deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-ad= vice)))) + (advice-remove 'read-answer 'dired-test-bug27940-advice)))) =20 =20 (provide 'dired-tests) From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jan 2018 03:38:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, drew.adams@oracle.com, tino.calancha@gmail.com Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151624663329886 (code B ref 30073); Thu, 18 Jan 2018 03:38:02 +0000 Received: (at 30073) by debbugs.gnu.org; 18 Jan 2018 03:37:13 +0000 Received: from localhost ([127.0.0.1]:60828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ec10r-0007ly-Gm for submit@debbugs.gnu.org; Wed, 17 Jan 2018 22:37:13 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45786) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ec10o-0007lh-GC for 30073@debbugs.gnu.org; Wed, 17 Jan 2018 22:37:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ec10i-0001b2-EM for 30073@debbugs.gnu.org; Wed, 17 Jan 2018 22:37:05 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20,T_RP_MATCHES_RCVD autolearn=disabled version=3.3.2 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:48138) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ec10Z-0001XH-J8; Wed, 17 Jan 2018 22:36:55 -0500 Received: from [176.228.60.248] (port=3201 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ec10Z-0002MN-0Q; Wed, 17 Jan 2018 22:36:55 -0500 Date: Thu, 18 Jan 2018 05:36:49 +0200 Message-Id: <831sinx2ge.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <8737345cy3.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 18 Jan 2018 00:03:04 +0200) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Date: Thu, 18 Jan 2018 00:03:04 +0200 > Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, > Tino Calancha > > But what I'm addressing here in bug#30073 is a regression. It's not a regression, since we never supported any user-defined changes to how questions are asked and answered. Users found a trick that exploited some internal implementation detail, and used it. Now that trick no longer works in this particular case, and new tricks are needed. Thus, making the customization "official" in this case is the only way to "fix" the "regression". Thanks for working on this. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jan 2018 21:36:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151631131212432 (code B ref 30073); Thu, 18 Jan 2018 21:36:02 +0000 Received: (at 30073) by debbugs.gnu.org; 18 Jan 2018 21:35:12 +0000 Received: from localhost ([127.0.0.1]:33778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecHq3-0003EQ-Q4 for submit@debbugs.gnu.org; Thu, 18 Jan 2018 16:35:11 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:47317 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecHq0-0003EH-8g for 30073@debbugs.gnu.org; Thu, 18 Jan 2018 16:35:09 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id F2DFB31A073; Thu, 18 Jan 2018 13:35:06 -0800 (PST) Received: from localhost.linkov.net (m91-129-98-183.cust.tele2.ee [91.129.98.183]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id AD74D31A078; Thu, 18 Jan 2018 13:35:05 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <83k1wjzokj.fsf@gnu.org> <87efmqaeea.fsf@mail.linkov.net> <83a7xdy9eo.fsf@gnu.org> <87inc0yt1y.fsf@mail.linkov.net> Date: Thu, 18 Jan 2018 23:11:30 +0200 In-Reply-To: <87inc0yt1y.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 18 Jan 2018 00:56:57 +0200") Message-ID: <877esfqegt.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> How many callers does it have now, and which callers are those? > > Currently it will have just one caller in =E2=80=98dired-delete-file=E2= =80=99, > but it's possible to gradually replace all callers that are using > =E2=80=98yes-or-no-p=E2=80=99 and =E2=80=98y-or-n-p=E2=80=99 with equiv= alent calls of =E2=80=98read-answer=E2=80=99 Sorry, I meant only =E2=80=98yes-or-no-p=E2=80=99, not =E2=80=98y-or-n-p=E2= =80=99. For =E2=80=98y-or-n-p=E2=80=99 there is no problem, and also there are se= veral alternatives like =E2=80=98map-y-or-n-p=E2=80=99, =E2=80=98read-multiple-choice=E2=80=99= ... But =E2=80=98yes-or-no-p=E2=80=99 is different because it's used for pote= ntially dangerous operations and should require typing long answers by default. Only when the user gives explicit consent it should allow shorter answers= . Actually this is like long and short options on command line, e.g. as described in (info "(coreutils) Common options"): "Most programs that accept long options recognize unambiguous abbreviations of those options. For example, `rmdir --ignore-fail-on-non-empty' can be invoked as `rmdir --ignore-fail' or even `rmdir --i'." From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 18 Jan 2018 21:36:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, drew.adams@oracle.com, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151631131612450 (code B ref 30073); Thu, 18 Jan 2018 21:36:03 +0000 Received: (at 30073) by debbugs.gnu.org; 18 Jan 2018 21:35:16 +0000 Received: from localhost ([127.0.0.1]:33781 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecHq6-0003Ef-3l for submit@debbugs.gnu.org; Thu, 18 Jan 2018 16:35:16 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:47321 helo=homiemail-a100.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ecHq4-0003ER-8q for 30073@debbugs.gnu.org; Thu, 18 Jan 2018 16:35:13 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id B6CE831A073; Thu, 18 Jan 2018 13:35:11 -0800 (PST) Received: from localhost.linkov.net (m91-129-98-183.cust.tele2.ee [91.129.98.183]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id B785A31A075; Thu, 18 Jan 2018 13:35:09 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> Date: Thu, 18 Jan 2018 23:12:06 +0200 In-Reply-To: <831sinx2ge.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 18 Jan 2018 05:36:49 +0200") Message-ID: <874lnjqeft.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --=-=-= Content-Type: text/plain > Thus, making the customization "official" in this case is the only way > to "fix" the "regression". > > Thanks for working on this. Here is a quite final patch I believe. At least, it works without noticed problems in my tests. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=read-answer.patch diff --git a/lisp/dired.el b/lisp/dired.el index b853d64..9a412d0 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2997,37 +2998,6 @@ dired-recursive-deletes ;; Match anything but `.' and `..'. (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") -(defconst dired-delete-help - "Type: -`yes' to delete recursively the current directory, -`no' to skip to next, -`all' to delete all remaining directories with no more questions, -`quit' to exit, -`help' to show this help message.") - -(defun dired--yes-no-all-quit-help (prompt &optional help-msg) - "Ask a question with valid answers: yes, no, all, quit, help. -PROMPT must end with '? ', for instance, 'Delete it? '. -If optional arg HELP-MSG is non-nil, then is a message to show when -the user answers 'help'. Otherwise, default to `dired-delete-help'." - (let ((valid-answers (list "yes" "no" "all" "quit")) - (answer "") - (input-fn (lambda () - (read-string - (format "%s [yes, no, all, quit, help] " prompt))))) - (setq answer (funcall input-fn)) - (when (string= answer "help") - (with-help-window "*Help*" - (with-current-buffer "*Help*" - (insert (or help-msg dired-delete-help))))) - (while (not (member answer valid-answers)) - (unless (string= answer "help") - (beep) - (message "Please answer `yes' or `no' or `all' or `quit'") - (sleep-for 2)) - (setq answer (funcall input-fn))) - answer)) - ;; Delete file, possibly delete a directory and all its files. ;; This function is useful outside of dired. One could change its name ;; to e.g. recursive-delete-file and put it somewhere else. @@ -3057,11 +3027,17 @@ dired-delete-file "trash" "delete") (dired-make-relative file)))) - (pcase (dired--yes-no-all-quit-help prompt) ; Prompt user. + (pcase (read-answer + prompt + '(("yes" ?y "delete recursively the current directory") + ("no" ?n "skip to next") + ("all" ?! "delete all remaining directories with no more questions") + ("quit" ?q "exit"))) ('"all" (setq recursive 'always dired-recursive-deletes recursive)) ('"yes" (if (eq recursive 'top) (setq recursive 'always))) ('"no" (setq recursive nil)) - ('"quit" (keyboard-quit))))) + ('"quit" (keyboard-quit)) + (_ (keyboard-quit))))) ; catch all unknown answers (setq recursive nil)) ; Empty dir or recursive is nil. (delete-directory file recursive trash)))) diff --git a/lisp/emacs-lisp/map-ynp.el b/lisp/emacs-lisp/map-ynp.el index 2a7edde..1b67dc2 100644 --- a/lisp/emacs-lisp/map-ynp.el +++ b/lisp/emacs-lisp/map-ynp.el @@ -256,4 +256,125 @@ map-y-or-n-p ;; Return the number of actions that were taken. actions)) + +;; read-answer is a general-purpose question-asker that supports +;; either long or short answers. + +;; For backward compatibility check if short y/n answers are preferred. +(defcustom read-answer-short (eq (symbol-function 'yes-or-no-p) 'y-or-n-p) + "If non-nil, accept short answers to the question." + :type 'boolean + :version "27.1" + :group 'minibuffer) + +(defconst read-answer-map--memoize (make-hash-table :weakness 'key :test 'equal)) + +(defun read-answer (question answers) + "Read an answer either as a complete word or its character abbreviation. +Ask user a question and accept an answer from the list of possible answers. + +QUESTION should end in a space; this function adds a list of answers to it. + +ANSWERS is an alist with elements in the following format: + (LONG-ANSWER SHORT-ANSWER HELP-MESSAGE) +where + LONG-ANSWER is a complete answer, + SHORT-ANSWER is an abbreviated one-character answer, + HELP-MESSAGE is a string describing the meaning of the answer. + +Example: + \\='((\"yes\" ?y \"perform the action\") + (\"no\" ?n \"skip to the next\") + (\"all\" ?! \"accept all remaining without more questions\") + (\"help\" ?h \"show help\") + (\"quit\" ?q \"exit\")) + +When `read-answer-short' is non-nil, accept short answers. + +Return a long answer even in case of accepting short ones. + +When `use-dialog-box' is t, pop up a dialog window to get user input." + (custom-reevaluate-setting 'read-answer-short) + (let* ((short read-answer-short) + (answers-with-help + (if (assoc "help" answers) + answers + (append answers '(("help" ?? "show this help message"))))) + (answers-without-help + (assoc-delete-all "help" (copy-alist answers-with-help))) + (prompt + (format "%s(%s) " question + (mapconcat (lambda (a) + (if short + (format "%c=%s" (nth 1 a) (nth 0 a)) + (nth 0 a))) + answers-with-help ", "))) + (message + (format "Please answer %s." + (mapconcat (lambda (a) + (format "`%s'" (if short + (string (nth 1 a)) + (nth 0 a)))) + answers-with-help " or "))) + (short-answer-map + (when short + (or (gethash answers read-answer-map--memoize) + (puthash answers + (let ((map (make-sparse-keymap))) + (set-keymap-parent map minibuffer-local-map) + (dolist (a answers-with-help) + (define-key map (vector (nth 1 a)) + (lambda () + (interactive) + (delete-minibuffer-contents) + (insert (nth 0 a)) + (exit-minibuffer)))) + (define-key map [remap self-insert-command] + (lambda () + (interactive) + (delete-minibuffer-contents) + (beep) + (message message) + (sleep-for 2))) + map) + read-answer-map--memoize)))) + answer) + (while (not (assoc (setq answer (downcase + (cond + ((and (display-popup-menus-p) + last-input-event ; not during startup + (listp last-nonmenu-event) + use-dialog-box) + (x-popup-dialog + t + (cons question + (mapcar (lambda (a) + (cons (capitalize (nth 0 a)) + (nth 0 a))) + answers-with-help)))) + (short + (read-from-minibuffer + prompt nil short-answer-map)) + (t + (read-from-minibuffer + prompt nil nil nil + 'yes-or-no-p-history))))) + answers-without-help)) + (if (string= answer "help") + (with-help-window "*Help*" + (with-current-buffer "*Help*" + (insert "Type:\n" + (mapconcat + (lambda (a) + (format "`%s'%s to %s" + (if short (string (nth 1 a)) (nth 0 a)) + (if short (format " (%s)" (nth 0 a)) "") + (nth 2 a))) + answers-with-help ",\n") + ".\n"))) + (beep) + (message message) + (sleep-for 2))) + answer)) + ;;; map-ynp.el ends here diff --git a/lisp/subr.el b/lisp/subr.el index 46cf5a3..092850a 100644 --- a/lisp/subr.el +++ b/lisp/subr.el @@ -705,6 +705,21 @@ member-ignore-case (setq list (cdr list))) list) +(defun assoc-delete-all (key alist) + "Delete from ALIST all elements whose car is `equal' to KEY. +Return the modified alist. +Elements of ALIST that are not conses are ignored." + (while (and (consp (car alist)) + (equal (car (car alist)) key)) + (setq alist (cdr alist))) + (let ((tail alist) tail-cdr) + (while (setq tail-cdr (cdr tail)) + (if (and (consp (car tail-cdr)) + (equal (car (car tail-cdr)) key)) + (setcdr tail (cdr tail-cdr)) + (setq tail tail-cdr)))) + alist) + (defun assq-delete-all (key alist) "Delete from ALIST all elements whose car is `eq' to KEY. Return the modified alist. diff --git a/test/lisp/dired-aux-tests.el b/test/lisp/dired-aux-tests.el index 89cb7b6..ab6d1cb 100644 --- a/test/lisp/dired-aux-tests.el +++ b/test/lisp/dired-aux-tests.el @@ -59,7 +59,7 @@ with-dired-bug28834-test (unwind-protect (if ,yes-or-no (cl-letf (((symbol-function 'yes-or-no-p) - (lambda (prompt) (eq ,yes-or-no 'yes)))) + (lambda (_prompt) (eq ,yes-or-no 'yes)))) ,@body) ,@body) ;; clean up diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index c024213..bb0e1bc 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -384,9 +384,9 @@ dired-test-with-temp-dirs (dired-test-with-temp-dirs 'just-empty-dirs (let (asked) - (advice-add 'dired--yes-no-all-quit-help + (advice-add 'read-answer :override - (lambda (_) (setq asked t) "") + (lambda (_q _a) (setq asked t) "") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -395,44 +395,44 @@ dired-test-with-temp-dirs (progn (should-not asked) (should-not (dired-get-marked-files))) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice)))) + (advice-remove 'read-answer 'dired-test-bug27940-advice)))) ;; Answer yes (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "yes") + (advice-add 'read-answer :override (lambda (_q _a) "yes") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should-not (dired-get-marked-files)) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer no (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "no") + (advice-add 'read-answer :override (lambda (_q _a) "no") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should (= 5 (length (dired-get-marked-files)))) ; Just the empty dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer all (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "all") + (advice-add 'read-answer :override (lambda (_q _a) "all") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) (dired-do-delete nil) (unwind-protect (should-not (dired-get-marked-files)) ; All dirs deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice))) + (advice-remove 'read-answer 'dired-test-bug27940-advice))) ;; Answer quit (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "quit") + (advice-add 'read-answer :override (lambda (_q _a) "quit") '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -440,7 +440,7 @@ dired-test-with-temp-dirs (dired-do-delete nil)) (unwind-protect (should (= 6 (length (dired-get-marked-files)))) ; All empty dirs but zeta-empty-dir deleted. - (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice)))) + (advice-remove 'read-answer 'dired-test-bug27940-advice)))) (provide 'dired-tests) --=-=-=-- From unknown Fri Jun 20 18:22:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Juri Linkov Subject: bug#30073: closed (Re: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers) Message-ID: References: <87fu6y6g2u.fsf@mail.linkov.net> <87bmi1cryh.fsf@mail.linkov.net> X-Gnu-PR-Message: they-closed 30073 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 30073@debbugs.gnu.org Date: Sun, 21 Jan 2018 21:48:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1516571283-7326-1" This is a multi-part message in MIME format... ------------=_1516571283-7326-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30073: 27.0.50; dired-do-delete ignores customization for short answers which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 30073@debbugs.gnu.org. --=20 30073: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30073 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1516571283-7326-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30073-done) by debbugs.gnu.org; 21 Jan 2018 21:47:28 +0000 Received: from localhost ([127.0.0.1]:37450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edNSa-0001t1-8A for submit@debbugs.gnu.org; Sun, 21 Jan 2018 16:47:28 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33476 helo=homiemail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edNSY-0001ss-Cq for 30073-done@debbugs.gnu.org; Sun, 21 Jan 2018 16:47:26 -0500 Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id D5F3F1C0066; Sun, 21 Jan 2018 13:47:25 -0800 (PST) Received: from localhost.linkov.net (m91-129-108-180.cust.tele2.ee [91.129.108.180]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPSA id 8A0051C0065; Sun, 21 Jan 2018 13:47:24 -0800 (PST) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> Date: Sun, 21 Jan 2018 23:46:01 +0200 In-Reply-To: <874lnjqeft.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 18 Jan 2018 23:12:06 +0200") Message-ID: <87fu6y6g2u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30073-done Cc: contovob@tcd.ie, 30073-done@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Thanks for working on this. > > Here is a quite final patch I believe. At least, it works > without noticed problems in my tests. Done. ------------=_1516571283-7326-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 Jan 2018 21:44:52 +0000 Received: from localhost ([127.0.0.1]:51430 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZOB2-0003Uj-0h for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:52 -0500 Received: from eggs.gnu.org ([208.118.235.92]:45940) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZOB0-0003UW-MY for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZOAu-0006Si-NL for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:45 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:43523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZOAu-0006SG-Cg for submit@debbugs.gnu.org; Wed, 10 Jan 2018 16:44:44 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36898) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eZOAt-0004yE-9X for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:44 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eZOAr-0006PA-8e for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:43 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:51829 helo=homiemail-a100.g.dreamhost.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1eZOAr-0006Ol-2U for bug-gnu-emacs@gnu.org; Wed, 10 Jan 2018 16:44:41 -0500 Received: from homiemail-a100.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTP id 0C63B31A073 for ; Wed, 10 Jan 2018 13:44:40 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-142.cust.tele2.ee [91.129.109.142]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a100.g.dreamhost.com (Postfix) with ESMTPSA id 609FD31A070 for ; Wed, 10 Jan 2018 13:44:39 -0800 (PST) From: Juri Linkov To: bug-gnu-emacs@gnu.org Subject: 27.0.50; dired-do-delete ignores customization for short answers Organization: LINKOV.NET Date: Wed, 10 Jan 2018 23:41:10 +0200 Message-ID: <87bmi1cryh.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] [fuzzy] X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) I customized =E2=80=98yes-or-no-p=E2=80=99 in ~/.emacs to short answers: (fset 'yes-or-no-p 'y-or-n-p) but now =E2=80=98dired-do-delete=E2=80=99 ignores this customization, and= always requires typing a full answer =E2=80=9Cyes=E2=80=9D with RET when deleting recursi= vely all subdirs, instead of accepting just a single letter =E2=80=98y=E2=80=99 as before t= he recent change. I think in this case better is to accept =E2=80=98y=E2=80=99 for =E2=80=9C= yes=E2=80=9D, and =E2=80=98!=E2=80=99 for =E2=80=9Call=E2=80=9D like in =E2=80=98query-replace-map=E2=80=99. ------------=_1516571283-7326-1-- From unknown Fri Jun 20 18:22:18 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Tino Calancha Subject: bug#28525: closed (Re: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers) Message-ID: References: <87fu6y6g2u.fsf@mail.linkov.net> <87mv5pn1dz.fsf@calancha-pc> X-Gnu-PR-Message: they-closed 28525 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 28525@debbugs.gnu.org Date: Sun, 21 Jan 2018 21:48:03 +0000 Content-Type: multipart/mixed; boundary="----------=_1516571283-7326-3" This is a multi-part message in MIME format... ------------=_1516571283-7326-3 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #30073: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to= y-or-n-p which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 28525@debbugs.gnu.org. --=20 30073: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D30073 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1516571283-7326-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 30073-done) by debbugs.gnu.org; 21 Jan 2018 21:47:28 +0000 Received: from localhost ([127.0.0.1]:37450 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edNSa-0001t1-8A for submit@debbugs.gnu.org; Sun, 21 Jan 2018 16:47:28 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:33476 helo=homiemail-a21.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1edNSY-0001ss-Cq for 30073-done@debbugs.gnu.org; Sun, 21 Jan 2018 16:47:26 -0500 Received: from homiemail-a21.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTP id D5F3F1C0066; Sun, 21 Jan 2018 13:47:25 -0800 (PST) Received: from localhost.linkov.net (m91-129-108-180.cust.tele2.ee [91.129.108.180]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a21.g.dreamhost.com (Postfix) with ESMTPSA id 8A0051C0065; Sun, 21 Jan 2018 13:47:24 -0800 (PST) From: Juri Linkov To: Eli Zaretskii Subject: Re: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> Date: Sun, 21 Jan 2018 23:46:01 +0200 In-Reply-To: <874lnjqeft.fsf@mail.linkov.net> (Juri Linkov's message of "Thu, 18 Jan 2018 23:12:06 +0200") Message-ID: <87fu6y6g2u.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 30073-done Cc: contovob@tcd.ie, 30073-done@debbugs.gnu.org, tino.calancha@gmail.com X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> Thanks for working on this. > > Here is a quite final patch I believe. At least, it works > without noticed problems in my tests. Done. ------------=_1516571283-7326-3 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 20 Sep 2017 15:14:38 +0000 Received: from localhost ([127.0.0.1]:50318 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dughy-0004AR-AG for submit@debbugs.gnu.org; Wed, 20 Sep 2017 11:14:38 -0400 Received: from eggs.gnu.org ([208.118.235.92]:43910) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dughw-00049n-Dm for submit@debbugs.gnu.org; Wed, 20 Sep 2017 11:14:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dugg9-0004jb-Td for submit@debbugs.gnu.org; Wed, 20 Sep 2017 11:14:31 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM, T_DKIM_INVALID autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:36381) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dugg9-0002wh-I1 for submit@debbugs.gnu.org; Wed, 20 Sep 2017 11:12:45 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51915) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dufZ5-0007MW-KJ for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2017 10:01:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dufYy-0007wH-V7 for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2017 10:01:23 -0400 Received: from mail-pf0-x235.google.com ([2607:f8b0:400e:c00::235]:54340) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dufYy-0007vk-M5 for bug-gnu-emacs@gnu.org; Wed, 20 Sep 2017 10:01:16 -0400 Received: by mail-pf0-x235.google.com with SMTP id d187so1563753pfg.11 for ; Wed, 20 Sep 2017 07:01:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=t5Z5OOXYnUbey5PTr76s0mDMsH6/qQ5ViccUPZ+ntNQ=; b=WAyctgU7vDt51YcKe7P6lyMDcxxnaZ3hpelrFSKypSodxYRx6BCmL7IAAlNm7MnMj4 N7sXyd2ZLbiSsocEMCboAWrKKNjUG71Pgm38JeFM7Mr6mmD0cB2diJVvAf1AAyR6DMQi BLtHTjeI5OXNnTPUbfzJADDj0afbeAUOIfA1VAQ0qsQWaGlOWzimafKIKnCucghSOHUZ S/MT+7gqVPosuFEfP1SLo2+phARaVPFD9Vl9Hwqrf7408b2y+3LslhEuhDTTddrGWNFd V2wb0VKyNZe4rS4eJwQR8zRmfkUHEo1I+y1x97ywwUhQG+73R8bMBz3cqiUy6Suls2pF 9nJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=t5Z5OOXYnUbey5PTr76s0mDMsH6/qQ5ViccUPZ+ntNQ=; b=jWf0IRmekqbgs6psWkPj9+bKCKEvsk/d3iMXca1I2VP03UW5rWwX6GCgMD2zDWpryY 42BYM39LlJyuQDefWbMS6h6J0zrXIPKgxiylkCoEpNkd9V137ooBP3YPzvAbpvvPCkfM Ldvkmj5UzED+DsFLw17ROxbbDe/DlN7cMtQxYLr6ouyVppMSma+uyuDgiMGmsA1BAMr+ CCxWw6j+AIHp/1/OnjToaDiXminSf8W5VVO/BTv/neXvhhVnB6SdQOATwIee3SeJUBw+ XGYs2CIZG9DUXwa/O2SoodintyEfPzGq8X+Dft2YD0h4/RClW009YrfBba9N6xR1B5Ho QapA== X-Gm-Message-State: AHPjjUgO5uqDthj49m5i6MolTqSe+vIl6iWSBpeyOjgpY5tbgHRsON1T MSl7W2uN7kU2PSOBMPDMTCkH/w== X-Google-Smtp-Source: AOwi7QCHThntgCRewifQK/4rj83jVM9JtapfbTP6s7bKJbSPtM2ip7BeZ6V64ey8aw14dkVFSFk1pg== X-Received: by 10.98.29.199 with SMTP id d190mr1603595pfd.74.1505901116539; Wed, 20 Sep 2017 02:51:56 -0700 (PDT) Received: from calancha-pc ([103.5.140.188]) by smtp.gmail.com with ESMTPSA id e69sm7034494pfc.79.2017.09.20.02.51.54 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 20 Sep 2017 02:51:55 -0700 (PDT) From: Tino Calancha To: bug-gnu-emacs@gnu.org Subject: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p Date: Wed, 20 Sep 2017 18:51:52 +0900 Message-ID: <87mv5pn1dz.fsf@calancha-pc> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.0 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.0 (----) X-Debbugs-CC: npostavs@users.sourceforge.net Tags: patch The following commit dired-do-delete: Allow to delete dirs recursively without prompts (cbea38e5c4af5386192fb9a48ef4fca5080d6561) doesn't consider the case when an user has aliased 'yes-or-no-p' to 'y-or-n-p'. That's annoying if you are used to the previous behaviour. I do. Recently, I had a private communication with an user whom complained about this recent change. Not sure about the ideal fix. The following patch work around the issue adding a new function 'dired-y-or-n-or-a-p', which is called when yes-or-no-p is aliased to y-or-n-p. This function is y-or-n-p with an additional possible answer '!' (aka, automatic), as in query-replace. --8<-----------------------------cut here---------------start------------->8--- commit d764d51c311a8bf6517f558bbdd5f11dff41a0ba Author: Tino Calancha Date: Wed Sep 20 18:28:52 2017 +0900 dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p Some users like to redefine yes-or-no-p as an alias of y-or-n-p. For backward compatibility 'dired-delete-file' must behave as usual in that case. * lisp/dired.el (defun dired-y-or-n-or-a-p): New defun. (dired--yes-no-all-quit-help): If yes-or-no-p is fset to y-or-n-p then call defun dired-y-or-n-or-a-p. (dired-delete-file): Update the pcase: it must handle 3 inputs (symbols): 'automatic, t or nil. (dired-delete-help): Delete variable. * test/lisp/dired-tests.el (dired-test-bug27940): Update test. diff --git a/lisp/dired.el b/lisp/dired.el index 782d8ffa51..80c2b9055f 100644 --- a/lisp/dired.el +++ b/lisp/dired.el @@ -2994,36 +2994,110 @@ dired-recursive-deletes ;; Match anything but `.' and `..'. (defvar dired-re-no-dot "^\\([^.]\\|\\.\\([^.]\\|\\..\\)\\).*") -(defconst dired-delete-help - "Type: -`yes' to delete recursively the current directory, -`no' to skip to next, -`all' to delete all remaining directories with no more questions, -`quit' to exit, -`help' to show this help message.") +(defun dired-y-or-n-or-a-p (prompt) + "Ask user a \"y or n or a\" question. +This is like `y-or-n-p' with an additional answer '!' to +proceed automatically with no mre questions." + (let ((answer 'recenter) + (padded (lambda (prompt &optional dialog) + (let ((l (length prompt))) + (concat prompt + (if (or (zerop l) (eq ?\s (aref prompt (1- l)))) + "" " ") + (if dialog "" "(y or n or !) ")))))) + (cond + (noninteractive + (setq prompt (funcall padded prompt)) + (let ((temp-prompt prompt)) + (while (not (memq answer '(act skip automatic))) + (let ((str (read-string temp-prompt))) + (cond ((member str '("y" "Y")) (setq answer 'act)) + ((member str '("!")) (setq answer 'automatic)) + ((member str '("n" "N")) (setq answer 'skip)) + (t (setq temp-prompt (concat "Please answer y or n or !. " + prompt)))))))) + ((and (display-popup-menus-p) + last-input-event ; not during startup + (listp last-nonmenu-event) + use-dialog-box) + (setq prompt (funcall padded prompt t) + answer (x-popup-dialog t `(,prompt ("Yes" . act) ("No" . skip) ("!" . automatic))))) + (t + (setq prompt (funcall padded prompt)) + (while + (let* ((scroll-actions '(recenter scroll-up scroll-down + scroll-other-window scroll-other-window-down)) + (key + (let ((cursor-in-echo-area t)) + (when minibuffer-auto-raise + (raise-frame (window-frame (minibuffer-window)))) + (read-key (propertize (if (memq answer scroll-actions) + prompt + (concat "Please answer y or n or !. " + prompt)) + 'face 'minibuffer-prompt))))) + (setq answer (lookup-key query-replace-map (vector key) t)) + (cond + ((memq answer '(skip act automatic)) nil) + ((eq answer 'recenter) + (recenter) t) + ((eq answer 'scroll-up) + (ignore-errors (scroll-up-command)) t) + ((eq answer 'scroll-down) + (ignore-errors (scroll-down-command)) t) + ((eq answer 'scroll-other-window) + (ignore-errors (scroll-other-window)) t) + ((eq answer 'scroll-other-window-down) + (ignore-errors (scroll-other-window-down)) t) + ((or (memq answer '(exit-prefix quit)) (eq key ?\e)) + (signal 'quit nil) t) + (t t))) + (ding) + (discard-input)))) + (let ((ret (cond ((eq answer 'act)) + (t (and (eq answer 'automatic) 'automatic))))) + (unless noninteractive + (message "%s%c" prompt (cond ((eq ret 'automatic) ?!) (t (if ret ?y ?n))))) + ret))) (defun dired--yes-no-all-quit-help (prompt &optional help-msg) "Ask a question with valid answers: yes, no, all, quit, help. PROMPT must end with '? ', for instance, 'Delete it? '. If optional arg HELP-MSG is non-nil, then is a message to show when the user answers 'help'. Otherwise, default to `dired-delete-help'." - (let ((valid-answers (list "yes" "no" "all" "quit")) - (answer "") - (input-fn (lambda () - (read-string - (format "%s [yes, no, all, quit, help] " prompt))))) - (setq answer (funcall input-fn)) - (when (string= answer "help") - (with-help-window "*Help*" - (with-current-buffer "*Help*" - (insert (or help-msg dired-delete-help))))) - (while (not (member answer valid-answers)) - (unless (string= answer "help") - (beep) - (message "Please answer `yes' or `no' or `all' or `quit'") - (sleep-for 2)) - (setq answer (funcall input-fn))) - answer)) + ;; Some people redefine 'yes-or-no-p as 'y-or-n-p; for backward + ;; compatibility we must check if that is the case. + (if (eq (symbol-function 'yes-or-no-p) 'y-or-n-p) + (dired-y-or-n-or-a-p prompt) + (let* ((valid-answers (list 'act 'skip 'automatic)) + (input-fn (lambda () + (let ((str + (read-string + (format "%s [yes, no, automatic, help] " prompt)))) + (cond ((string-match "\\`yes\\'" str) 'act) + ((string-match "\\`no\\'" str) 'skip) + ((string-match "\\`automatic\\'" str) 'automatic) + ((string-match "\\`help\\'" str) 'help))))) + (dired-delete-help + (format "Type: +`%s' to delete recursively the current directory, +`%s' to skip to next, +`%s' to delete automatic remaining directories with no more questions, +`%s' to show this help message." + "yes" "no" "automatic" "help"))) + (let ((answer (funcall input-fn))) + (when (eq answer 'help) + (with-help-window "*Help*" + (with-current-buffer "*Help*" + (insert (or help-msg dired-delete-help))))) + (while (not (member answer valid-answers)) + (unless (eq answer 'help) + (beep) + (message "Please answer `yes' or `no' or `automatic'") + (sleep-for 2)) + (setq answer (funcall input-fn))) + (cond ((eq answer 'act)) + (t (and (eq answer 'automatic) 'automatic))))))) ;; Delete file, possibly delete a directory and all its files. ;; This function is useful outside of dired. One could change its name @@ -3055,10 +3129,9 @@ dired-delete-file "delete") (dired-make-relative file)))) (pcase (dired--yes-no-all-quit-help prompt) ; Prompt user. - ('"all" (setq recursive 'always dired-recursive-deletes recursive)) - ('"yes" (if (eq recursive 'top) (setq recursive 'always))) - ('"no" (setq recursive nil)) - ('"quit" (keyboard-quit))))) + ('automatic (setq recursive 'always dired-recursive-deletes recursive)) + ('t (if (eq recursive 'top) (setq recursive 'always))) + ('nil (setq recursive nil))))) (setq recursive nil)) ; Empty dir or recursive is nil. (delete-directory file recursive trash)))) diff --git a/test/lisp/dired-tests.el b/test/lisp/dired-tests.el index 99006eca3e..fb9988ee06 100644 --- a/test/lisp/dired-tests.el +++ b/test/lisp/dired-tests.el @@ -399,7 +399,7 @@ dired-test-with-temp-dirs ;; Answer yes (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "yes") + (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) t) '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -410,7 +410,7 @@ dired-test-with-temp-dirs ;; Answer no (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "no") + (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) nil) '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -418,10 +418,10 @@ dired-test-with-temp-dirs (unwind-protect (should (= 5 (length (dired-get-marked-files)))) ; Just the empty dirs deleted. (advice-remove 'dired--yes-no-all-quit-help 'dired-test-bug27940-advice))) - ;; Answer all + ;; Answer automatic (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "all") + (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) 'automatic) '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) @@ -432,7 +432,7 @@ dired-test-with-temp-dirs ;; Answer quit (dired-test-with-temp-dirs nil - (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) "quit") + (advice-add 'dired--yes-no-all-quit-help :override (lambda (_) (signal 'quit nil)) '((name . dired-test-bug27940-advice))) (dired default-directory) (dired-toggle-marks) --8<-----------------------------cut here---------------end--------------->8--- In GNU Emacs 27.0.50 (build 10, x86_64-pc-linux-gnu, GTK+ Version 3.22.11) of 2017-09-20 built on calancha-pc Repository revision: b1f83c10df7d1bbb16f4e13d18119ad4aa1a2137 ------------=_1516571283-7326-3-- From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jan 2018 18:06:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov , Eli Zaretskii Cc: contovob@tcd.ie, 30073-done@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-done@debbugs.gnu.org id=D30073.151690350522665 (code D ref 30073); Thu, 25 Jan 2018 18:06:02 +0000 Received: (at 30073-done) by debbugs.gnu.org; 25 Jan 2018 18:05:05 +0000 Received: from localhost ([127.0.0.1]:42793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeltZ-0005tV-DA for submit@debbugs.gnu.org; Thu, 25 Jan 2018 13:05:05 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:57162) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeltY-0005sz-Di for 30073-done@debbugs.gnu.org; Thu, 25 Jan 2018 13:05:04 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0PI1g9u164579; Thu, 25 Jan 2018 18:04:57 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=YTKHrcFrWrhyBEJDOurxcHbrIpZGJM2lkHhRPtBu9aw=; b=odh05Ia3uTN/XV18bsVGzgTyqKgHRo8CR1H2/77NalB7H3Z+/WbC1OxZeNz9dmuRWlfm Ul83AOJBYunDVuiorqS5cIXNcovzr0LuqiRLcrP3MT39x3S3QfKrD7OWT+cV3Sdy2ar4 5qw0aJu4qtkBIgrSllugTl6AE8FR450wx35AJ9ygrLALzMxVea8rJVmbjuiLsmR+oPBc Xn1Erpv4DKbDUqkdVEKLh3gX5lCmVf5KMmDtHdjF7Kpq/X9gmO9/yDdMPRtWkn9iPcj8 xZMblPesxcfq5W9Z2lQnBFeuGb8oRebPF9z52y2jJ578Tzka51s3jNfwDZwg1Ix4we8q NA== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2120.oracle.com with ESMTP id 2fqk6h0ddc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jan 2018 18:04:57 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w0PI4vq4020520 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jan 2018 18:04:57 GMT Received: from abhmp0019.oracle.com (abhmp0019.oracle.com [141.146.116.25]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0PI4tBR010513; Thu, 25 Jan 2018 18:04:55 GMT MIME-Version: 1.0 Message-ID: <42321f96-82d6-4aed-81e9-c793a668982f@default> Date: Thu, 25 Jan 2018 10:04:53 -0800 (PST) From: Drew Adams References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> <87fu6y6g2u.fsf@mail.linkov.net> In-Reply-To: <87fu6y6g2u.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8785 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=996 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801250242 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > Done. The function name is not good. `read-answer' suggests reading an answer to any question. This is very far from that. This is (IIUC) only about reading an answer to a yes/no question (typically a confirmation question). `read-confirmation' would be much clearer, as any yes/no question can pretty much be considered a question asking for confirmation. (`read-yes-no' would be more exact, but for some (given history) it would suggest reading the inputs `yes' and `no', and not just reading anything that is interpreted as yes or no.) Anyway, as I made clear, I'm not crazy about this fix. If we want to generalize reading yes/no questions we should do so in a better way, including providing an easy way for the possible answers to be expressed in other languages than English. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jan 2018 21:45:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Drew Adams Cc: contovob@tcd.ie, Eli Zaretskii , 30073@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15169166469500 (code B ref 30073); Thu, 25 Jan 2018 21:45:02 +0000 Received: (at 30073) by debbugs.gnu.org; 25 Jan 2018 21:44:06 +0000 Received: from localhost ([127.0.0.1]:42893 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepJW-0002TA-H4 for submit@debbugs.gnu.org; Thu, 25 Jan 2018 16:44:06 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:48848 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepJV-0002T3-3L for 30073@debbugs.gnu.org; Thu, 25 Jan 2018 16:44:05 -0500 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 91CD1258068; Thu, 25 Jan 2018 13:44:04 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-224.cust.tele2.ee [91.129.109.224]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id 1B780258066; Thu, 25 Jan 2018 13:44:02 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> <87fu6y6g2u.fsf@mail.linkov.net> <42321f96-82d6-4aed-81e9-c793a668982f@default> Date: Thu, 25 Jan 2018 23:20:57 +0200 In-Reply-To: <42321f96-82d6-4aed-81e9-c793a668982f@default> (Drew Adams's message of "Thu, 25 Jan 2018 10:04:53 -0800 (PST)") Message-ID: <87h8r962y6.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 0.0 (/) > The function name is not good. `read-answer' suggests reading an answe= r > to any question. That's right, reading an answer to any question: (read-answer "What color do you like? " '(("red" ?r) ("green" ?g) ("blue" ?b) ("white" ?w))) > If we want to generalize reading yes/no questions we should do so > in a better way, including providing an easy way for the possible > answers to be expressed in other languages than English. It is already generalized: (read-answer "Comprenez-vous? " '(("oui" ?o) ("non" ?n) ("bien s=FBr" ?b) ("pas du tout" ?p))) From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Drew Adams Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 25 Jan 2018 21:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, Eli Zaretskii , 30073@debbugs.gnu.org, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.151691690210003 (code B ref 30073); Thu, 25 Jan 2018 21:49:01 +0000 Received: (at 30073) by debbugs.gnu.org; 25 Jan 2018 21:48:22 +0000 Received: from localhost ([127.0.0.1]:42910 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepNd-0002bG-Mt for submit@debbugs.gnu.org; Thu, 25 Jan 2018 16:48:21 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:53892) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eepNb-0002b2-Ni for 30073@debbugs.gnu.org; Thu, 25 Jan 2018 16:48:20 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w0PLkqGn179928; Thu, 25 Jan 2018 21:48:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=5KAybIyZS2ER4niP55+xHE3K3j1AjanBhU6y4l/tOS8=; b=lULqCZdzxAM0RDqCRrSlOtHT/qWrYU3pKABm8QouneTd2cG467xTNMQlGz8OQA2UxI60 sIA/8Oxy4qMID7iTkTUEFyO1lEXuk4ZIOHX0pAKg3VVMFbo6CmS4qm+Dk+lJAMIn/nAt +Im8qVZyU9e+WlnvFBwLjIRwISQ7EsKJ/Xc/DX5tc/V9CQ58VgTzM9M2kYafpzzP4QgO Vf1O+dROt6zIGuUVdcb5CyKWRwxGvrnkTPJz/0ceO+gB1qXyFia2vyGVR5GVx+jTAQy5 UMivdgCtwHuwUr6DV2sSIvMyS818pvsb0JE7o1ugCF8Bjc1FE2krtHd4F17HHFDtxKJ2 5g== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp2130.oracle.com with ESMTP id 2fqqc1r0yp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 25 Jan 2018 21:48:12 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w0PLmBcg018097 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 25 Jan 2018 21:48:11 GMT Received: from abhmp0001.oracle.com (abhmp0001.oracle.com [141.146.116.7]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w0PLmAec021699; Thu, 25 Jan 2018 21:48:10 GMT MIME-Version: 1.0 Message-ID: <3fab53d5-37e0-4190-8852-ee0156240897@default> Date: Thu, 25 Jan 2018 13:48:08 -0800 (PST) From: Drew Adams References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> <87fu6y6g2u.fsf@mail.linkov.net> <42321f96-82d6-4aed-81e9-c793a668982f@default> <87h8r962y6.fsf@mail.linkov.net> In-Reply-To: <87h8r962y6.fsf@mail.linkov.net> X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4639.0 (x86)] Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8785 signatures=668655 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=627 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1801250288 X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) > That's right, reading an answer to any question: >=20 > (read-answer > "What color do you like? " > '(("red" ?r) > ("green" ?g) > ("blue" ?b) > ("white" ?w))) >=20 > It is already generalized: >=20 > (read-answer > "Comprenez-vous? " > '(("oui" ?o) > ("non" ?n) > ("bien s=FBr" ?b) > ("pas du tout" ?p))) OK, good. Thx. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Jan 2018 07:59:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Juri Linkov Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, drew.adams@oracle.com, tino.calancha@gmail.com Reply-To: Eli Zaretskii Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15169534826645 (code B ref 30073); Fri, 26 Jan 2018 07:59:01 +0000 Received: (at 30073) by debbugs.gnu.org; 26 Jan 2018 07:58:02 +0000 Received: from localhost ([127.0.0.1]:43043 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeytd-0001j2-Nf for submit@debbugs.gnu.org; Fri, 26 Jan 2018 02:58:01 -0500 Received: from eggs.gnu.org ([208.118.235.92]:49970) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eeytb-0001ia-IM for 30073@debbugs.gnu.org; Fri, 26 Jan 2018 02:58:00 -0500 Received: from fencepost.gnu.org ([208.118.235.10]:53187) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eeytV-0004aV-L6; Fri, 26 Jan 2018 02:57:53 -0500 Received: from [176.228.60.248] (port=4539 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eeytU-0005VA-TM; Fri, 26 Jan 2018 02:57:53 -0500 Date: Fri, 26 Jan 2018 09:57:51 +0200 Message-Id: <83607pm4qo.fsf@gnu.org> From: Eli Zaretskii In-reply-to: <87h8r962y6.fsf@mail.linkov.net> (message from Juri Linkov on Thu, 25 Jan 2018 23:20:57 +0200) References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> <87fu6y6g2u.fsf@mail.linkov.net> <42321f96-82d6-4aed-81e9-c793a668982f@default> <87h8r962y6.fsf@mail.linkov.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Spam-Score: -5.0 (-----) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) > From: Juri Linkov > Cc: Eli Zaretskii , contovob@tcd.ie, 30073@debbugs.gnu.org, tino.calancha@gmail.com > Date: Thu, 25 Jan 2018 23:20:57 +0200 > > > The function name is not good. `read-answer' suggests reading an answer > > to any question. > > That's right, reading an answer to any question: How about ask-question-read-response instead? I'm afraid read-answer will make sense only to speakers of some languages, but not to others. Thanks. From unknown Fri Jun 20 18:22:18 2025 X-Loop: help-debbugs@gnu.org Subject: bug#30073: 27.0.50; dired-do-delete ignores customization for short answers Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 27 Jan 2018 21:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 30073 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: Eli Zaretskii Cc: contovob@tcd.ie, 30073@debbugs.gnu.org, drew.adams@oracle.com, tino.calancha@gmail.com Received: via spool by 30073-submit@debbugs.gnu.org id=B30073.15170896044124 (code B ref 30073); Sat, 27 Jan 2018 21:47:02 +0000 Received: (at 30073) by debbugs.gnu.org; 27 Jan 2018 21:46:44 +0000 Received: from localhost ([127.0.0.1]:45555 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efYJA-00014R-10 for submit@debbugs.gnu.org; Sat, 27 Jan 2018 16:46:44 -0500 Received: from sub3.mail.dreamhost.com ([69.163.253.7]:43194 helo=homiemail-a18.g.dreamhost.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1efYJ7-00014J-TY for 30073@debbugs.gnu.org; Sat, 27 Jan 2018 16:46:42 -0500 Received: from homiemail-a18.g.dreamhost.com (localhost [127.0.0.1]) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTP id 66FA3258067; Sat, 27 Jan 2018 13:46:41 -0800 (PST) Received: from localhost.linkov.net (m91-129-109-224.cust.tele2.ee [91.129.109.224]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by homiemail-a18.g.dreamhost.com (Postfix) with ESMTPSA id E34E0258066; Sat, 27 Jan 2018 13:46:39 -0800 (PST) From: Juri Linkov Organization: LINKOV.NET References: <87bmi1cryh.fsf@mail.linkov.net> <87o9m1nlpl.fsf@gmail.com> <83po6g4cky.fsf@gnu.org> <87vag8f4da.fsf@mail.linkov.net> <83fu7b2yda.fsf@gnu.org> <87y3l1e68y.fsf@mail.linkov.net> <871sis66w1.fsf@gmail.com> <874lno10di.fsf@mail.linkov.net> <87d12aaedz.fsf@mail.linkov.net> <8737345cy3.fsf@mail.linkov.net> <831sinx2ge.fsf@gnu.org> <874lnjqeft.fsf@mail.linkov.net> <87fu6y6g2u.fsf@mail.linkov.net> <42321f96-82d6-4aed-81e9-c793a668982f@default> <87h8r962y6.fsf@mail.linkov.net> <83607pm4qo.fsf@gnu.org> Date: Sat, 27 Jan 2018 23:20:20 +0200 In-Reply-To: <83607pm4qo.fsf@gnu.org> (Eli Zaretskii's message of "Fri, 26 Jan 2018 09:57:51 +0200") Message-ID: <87372r0zj9.fsf@mail.linkov.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) >> That's right, reading an answer to any question: > > How about ask-question-read-response instead? I'm afraid read-answer > will make sense only to speakers of some languages, but not to others. I really don't see why 'read-response' would be better than 'read-answer', when "answer" is a synonym of "response".