all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tino Calancha <tino.calancha@gmail.com>
To: Drew Adams <drew.adams@oracle.com>
Cc: 28525@debbugs.gnu.org, Tino Calancha <tino.calancha@gmail.com>,
	npostavs@users.sourceforge.net
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)	[thread overview]
Message-ID: <alpine.DEB.2.20.1710021439300.6227@calancha-pc> (raw)
In-Reply-To: <3440084b-1e2d-44d8-a291-44d6622bbbbc@default>



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.





  reply	other threads:[~2017-10-02  5:40 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-20  9:51 bug#28525: 26.0.60; dired-delete-file: Accept y/n if yes-or-no-p is aliased to y-or-n-p Tino Calancha
2017-09-21  8:15 ` Eli Zaretskii
2017-09-30 13:00   ` Tino Calancha
2017-10-01  4:06     ` Tino Calancha
2017-10-01 23:15       ` Drew Adams
2017-10-02  5:40         ` Tino Calancha [this message]
2017-10-02 13:33           ` Drew Adams
2017-10-03  8:02             ` Tino Calancha
2017-10-02 17:41       ` Eli Zaretskii
2017-10-03  8:00         ` Tino Calancha
2017-10-03 11:10           ` Michael Heerdegen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.20.1710021439300.6227@calancha-pc \
    --to=tino.calancha@gmail.com \
    --cc=28525@debbugs.gnu.org \
    --cc=drew.adams@oracle.com \
    --cc=npostavs@users.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.