all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Stephen J. Turnbull" <stephen@xemacs.org>
To: Marcin Borkowski <mbork@mbork.pl>
Cc: Eli Zaretskii <eliz@gnu.org>, emacs-devel@gnu.org
Subject: Re: yes-or-no-p prompt conditionally broken in master?
Date: Sat, 05 Sep 2015 14:02:18 +0900	[thread overview]
Message-ID: <87pp1x31d1.fsf@uwakimon.sk.tsukuba.ac.jp> (raw)
In-Reply-To: <87si6umqbs.fsf@mbork.pl>

Marcin Borkowski writes:
 > On 2015-09-04, at 11:26, Andreas Schwab <schwab@linux-m68k.org> wrote:
 > > Eli Zaretskii <eliz@gnu.org> writes:
 > >
 > >> Any objections to removing yes-or-no-p (with a defalias for backward
 > >> compatibility, of course) and making y-or-n-p serve both duties,
 > >> controlled by some defcustom?
 > >
 > > That doesn't make sense.  They implement different intented
 > > meaning.

The API would need an argument to control it, and in that sense Eli's
proposal is incomplete.  But it makes sense.

 > +1.  They serve different purposes, and they are both needed.

Both semantics are useful, but they serve the same basic purpose.
There's no good reason for having separate APIs, and it's arguable
that maintaining parallel syntax is sufficient reason for unifying as
a single API, given some core developers' aversion to making promises
about consistency of API.

If I were a "I never saw a behavior that I wouldn't make optional"
fanatic, I'd go on to propose an elaborate API and UI, where the main
function would be

    (defun user-confirmation (prompt oracle)   ; not optional!!
      "The docstring is left as an exercise for the reader."
      (if (functionp oracle)
          (funcall oracle prompt)
        t))                ; #### too fragile in the face of typos?

And the options would be stuff like:

    (defcustom user-confirmation-fatfinger-fandango 'y-or-n-p)
    (defcustom user-confirmation-irreversible-change 'yes-or-no-p)
    (defcustom user-confirmation-truly-timid-user "don't bother me!")
    (defcustom user-confirmation-authenticate 'reauthenticate-user)

But I really don't see the need for a unification or generalization.
The two levels are enough.  Security-relevant cases will probably
have their own mechanisms anyway, and nobody would be very likely to
want to set truly-timid-user to anything other than "don't bug me".

Nor can I see any reason why the syntax would need to diverge.  Just
promise that (defalias 'yes-or-no-p 'y-or-n-p) will work forever.  If
necessary to change one or the other's signature, add dummy arguments
to the function whose implementation doesn't change.




  parent reply	other threads:[~2015-09-05  5:02 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-03 16:31 yes-or-no-p prompt conditionally broken in master? Kaushal Modi
2015-09-03 16:39 ` Eli Zaretskii
2015-09-03 17:22   ` Artur Malabarba
2015-09-03 17:28     ` Dmitry Gutov
2015-09-03 17:43       ` Tassilo Horn
2015-09-03 17:43       ` Eli Zaretskii
2015-09-03 17:47         ` Dmitry Gutov
2015-09-03 18:02           ` Eli Zaretskii
2015-09-03 18:18             ` Artur Malabarba
2015-09-03 18:19               ` Eli Zaretskii
2015-09-03 18:23               ` Drew Adams
2015-09-03 18:27                 ` Eli Zaretskii
2015-09-03 18:43                   ` Artur Malabarba
2015-09-03 18:45                     ` Kaushal Modi
2015-09-04  9:02                     ` Eli Zaretskii
2015-09-04  9:14                       ` David Kastrup
2015-09-04 12:33                         ` Eli Zaretskii
2015-09-04  9:16                       ` Bastien
2015-09-04  9:26                       ` Andreas Schwab
2015-09-04 10:32                         ` Marcin Borkowski
2015-09-04 11:03                           ` David Kastrup
2015-09-04 11:52                             ` Kaushal Modi
2015-09-04 12:30                           ` Eli Zaretskii
2015-09-04 12:39                             ` Marcin Borkowski
2015-09-05  5:02                           ` Stephen J. Turnbull [this message]
2015-09-04 12:28                         ` Eli Zaretskii
2015-09-04 12:40                           ` Andreas Schwab
2015-09-04 12:58                             ` Eli Zaretskii
2015-09-04 13:34                               ` Alan Mackenzie
2015-09-04 17:56                                 ` Eli Zaretskii
2015-09-04 18:14                                   ` David Kastrup
2015-09-04 18:28                                     ` Eli Zaretskii
2015-09-04 18:39                                       ` David Kastrup
2015-09-04 18:52                                         ` Kaushal Modi
2015-09-04 18:53                                           ` Kaushal Modi
2015-09-04 19:47                                         ` Eli Zaretskii
2015-09-04 19:55                                           ` Eli Zaretskii
2015-09-04 20:00                                             ` David Kastrup
2015-09-04 20:04                                             ` David Kastrup
2015-09-05  7:03                                               ` Eli Zaretskii
2015-09-05  7:20                                                 ` David Kastrup
2015-09-04 19:56                                           ` David Kastrup
2015-09-04 18:36                                   ` Alan Mackenzie
2015-09-04 17:31                               ` Chad Brown
2015-09-04 17:54                                 ` Eli Zaretskii
2015-09-04 12:59                             ` Kaushal Modi
2015-09-04 14:42                               ` Drew Adams
2015-09-04 13:24                       ` Stefan Monnier
2015-09-04 13:49                         ` David Kastrup
2015-09-04 17:41                           ` Eli Zaretskii
2015-09-04 17:39                         ` Eli Zaretskii
2015-09-03 18:27             ` Dmitry Gutov
2015-09-03 18:30               ` Eli Zaretskii
2015-09-03 18:33                 ` Dmitry Gutov
2015-09-03 18:18           ` Marcin Borkowski
2015-09-03 18:25             ` Dmitry Gutov
2015-09-03 18:28               ` Eli Zaretskii
2015-09-03 18:33                 ` David Kastrup
2015-09-03 21:47                   ` Andy Moreton
2015-09-04  6:32                   ` Eli Zaretskii
2015-09-04  6:48                     ` Andreas Schwab
2015-09-04  7:00                       ` Eli Zaretskii
2015-09-04  9:25                         ` Andreas Schwab
2015-09-05  4:06                         ` Stephen J. Turnbull
2015-09-03 19:26               ` Marcin Borkowski
2015-09-03 17:47         ` Kaushal Modi
2015-09-04 12:29         ` Wolfgang Jenkner
2015-09-04 12:36           ` Eli Zaretskii
2015-09-03 22:31   ` Katsumi Yamaoka
2015-09-03 23:02     ` bug#21408: 25.0.50; yes-or-no-p prompt doesn't appear Katsumi Yamaoka
2015-09-03 23:53       ` Kaushal Modi
2015-09-04  0:23         ` Katsumi Yamaoka
2015-09-03 23:54     ` yes-or-no-p prompt conditionally broken in master? Kaushal Modi

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=87pp1x31d1.fsf@uwakimon.sk.tsukuba.ac.jp \
    --to=stephen@xemacs.org \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=mbork@mbork.pl \
    /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.