From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Tino Calancha Newsgroups: gmane.emacs.bugs Subject: bug#28525: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p Date: Mon, 2 Oct 2017 14:40:20 +0900 (JST) Message-ID: References: <87mv5pn1dz.fsf@calancha-pc> <83zi9oeacc.fsf@gnu.org> <87tvzktk75.fsf@gmail.com> <87poa7tstz.fsf@gmail.com> <3440084b-1e2d-44d8-a291-44d6622bbbbc@default> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Trace: blaine.gmane.org 1506922991 23298 195.159.176.226 (2 Oct 2017 05:43:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 2 Oct 2017 05:43:11 +0000 (UTC) User-Agent: Alpine 2.20 (DEB 67 2015-01-07) Cc: 28525@debbugs.gnu.org, Tino Calancha , npostavs@users.sourceforge.net To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Oct 02 07:43:06 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dytVS-0005a2-1r for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Oct 2017 07:43:06 +0200 Original-Received: from localhost ([::1]:50722 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dytVY-0005N7-9y for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Oct 2017 01:43:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:40421) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dytTX-0004Rs-S7 for bug-gnu-emacs@gnu.org; Mon, 02 Oct 2017 01:41:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dytTS-0003cA-UO for bug-gnu-emacs@gnu.org; Mon, 02 Oct 2017 01:41:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:34640) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1dytTS-0003c5-QZ for bug-gnu-emacs@gnu.org; Mon, 02 Oct 2017 01:41:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1dytTS-00075k-Eb for bug-gnu-emacs@gnu.org; Mon, 02 Oct 2017 01:41:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Tino Calancha Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Oct 2017 05:41:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28525 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28525-submit@debbugs.gnu.org id=B28525.150692283227211 (code B ref 28525); Mon, 02 Oct 2017 05:41:02 +0000 Original-Received: (at 28525) by debbugs.gnu.org; 2 Oct 2017 05:40:32 +0000 Original-Received: from localhost ([127.0.0.1]:43321 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dytSx-00074p-Uq for submit@debbugs.gnu.org; Mon, 02 Oct 2017 01:40:32 -0400 Original-Received: from mail-pg0-f41.google.com ([74.125.83.41]:56544) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dytSw-00074b-AC for 28525@debbugs.gnu.org; Mon, 02 Oct 2017 01:40:30 -0400 Original-Received: by mail-pg0-f41.google.com with SMTP id n1so1761211pgt.13 for <28525@debbugs.gnu.org>; Sun, 01 Oct 2017 22:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=mQX/et1NovT9gzFbQCuwNKH4+O9HPuCoOLDDgFw7FvI=; b=LjkVbuNAqapPfOVc6mjg+PTqN9YCJPRLBiDkbYYkzAZkYgL8b1YYzWrkXLR10WrQNE Yq0A7cSqUsas3fKsLXnrknNXDBW7bvYWUH7zAVqlPqbIY3YNKLOK2L7wYwKfZ2pG3P1J akVOqXckPOCFa6OkoDtETi40zOuPkRKfNS8EgO4FAbO1Pe7K2ThrwQF4mSi2LRbXmSh2 TEz7hVStmcMSXN1XMG4gvP5Ad4V90bSnGufrA9/VFOu0k4HqX0Vc0Btu5VASBPY53Ier jf+QEUHt5zOkiA9gfFYjCwH3mqCjOf2Hm3bZFJEdE5ygHz7TedeliymDCkbWwUjo5Gss A+4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=mQX/et1NovT9gzFbQCuwNKH4+O9HPuCoOLDDgFw7FvI=; b=CYiPNsx+GpewmllXX4a1wETGZ9N49O+/9PdralZX5M/ZQd3TALUm3adxgb1hy/90R2 14M3VVfj/eeuZP4ldhPq3NeQnsA0PMGT/uQxC1wvCcbGTzvROA0BxgRK32PJiw2cmgyI Km4/50h/cNAm2NqE5Ul0m0gkis6pD2Bh3/qzeqxqBNflWbbFEpM2gWPngi/w1H7d4uo/ QpxiJdEA+mjCuzKaUyj6n+CBYeJH8s+2jaay+aqrNgqeAZJto6kAv8OfHuS+Bdmk6Izj 4EvGWJmWTMyW8Kr2GUmjsXfm5tfqIXcGeERjK8gGeARyWYK6+fdMTUb6xU2TUN/txCgO gTgA== X-Gm-Message-State: AHPjjUhq1eB/K4kJe5iRCciTviKEECKzhsllW6dP/pALG8FXH7RupeRr 775rxQyWEEqgra5KrNqh4Zg= X-Google-Smtp-Source: AOwi7QBb5x7+wKdWwwyInVnIApawZc8Ch8/OH1ZMmImVh7YbcuEVOFi7D5HAiQ1xmGx7dnYjx/TP6g== X-Received: by 10.159.206.134 with SMTP id bg6mr8822821plb.273.1506922824350; Sun, 01 Oct 2017 22:40:24 -0700 (PDT) Original-Received: from calancha-pc (203.191.218.133.dy.bbexcite.jp. [133.218.191.203]) by smtp.gmail.com with ESMTPSA id q125sm6755216pfb.104.2017.10.01.22.40.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 01 Oct 2017 22:40:23 -0700 (PDT) X-Google-Original-From: Tino Calancha X-X-Sender: calancha@calancha-pc In-Reply-To: <3440084b-1e2d-44d8-a291-44d6622bbbbc@default> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137765 Archived-At: On Sun, 1 Oct 2017, Drew Adams wrote: > FWIW: I don't think that Emacs should test for > function aliases and change its behavior accordingly. > > I don't think users should be encouraged to alias > `yes-or-no-p' to `y-or-n-p'. That's a bad idea > _in general_, IMO, even if it some users might > find it's appropriate for them. > > I think that making Emacs code automatically > recognize such an alias just encourages such > (bad) practice on the part of users. > > ---- > > FWIW2: It can, however, be helpful to let users > override a design choice of `y-or-n-p' or > `yes-or-no-p' _for a given calling function_ > (as opposed to globally). I've written library > Yes-No, to provide such a feature. > > https://www.emacswiki.org/emacs/Yes-No Thank you for the detailed answer. Your library looks a good solution to add more control where to allow aliasing 'yes-or-no-p to 'y-or-n-p. Here, what i am trying to propose is different: extend the 'yes or no' functions (or add two new functions), so that they accept more than 2 answers. This is inpired in the way `query-replace' works: M-% a RET o RET This prompts to replace 'a' with 'o'. In principle this looks like a 'yes or no' question; actually we can provide additional answers: all possibilities are listed if the user inputs 'h'. For example, '!' performs all replacements without further questions. We find something similar in dired-delete-file: in addition to 'yes', 'no', we can answer to delete all the dirs with no more questions. A function like 'yes-or-no-p' accepting more than 2 answers might be used to handle the examples above, and future cases.