unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: David Kastrup <dak@gnu.org>, Eli Zaretskii <eliz@gnu.org>
Cc: bruce.connor.am@gmail.com, emacs-devel@gnu.org,
	schwab@linux-m68k.org, monnier@iro.umontreal.ca,
	dgutov@yandex.ru, acm@muc.de, drew.adams@oracle.com
Subject: Re: yes-or-no-p prompt conditionally broken in master?
Date: Fri, 04 Sep 2015 18:52:21 +0000	[thread overview]
Message-ID: <CAFyQvY16cvLey9j-4r-37pgy67G5ETQg6hLzhfw8M5jSJnze8g@mail.gmail.com> (raw)
In-Reply-To: <877fo6t4f9.fsf@fencepost.gnu.org>

[-- Attachment #1: Type: text/plain, Size: 2383 bytes --]

@Eli, @Drew

Would this psuedocode work?

(progn
  ;; Possible values: nil, 'quick, 'verbose
  ;; (defconst yes-or-no-option nil)
  ;; (defconst yes-or-no-option 'quick)
  (defconst yes-or-no-option 'verbose)
  ;; If nil, yes-or-no-p and y-or-n-p will work their traditional ways
  ;; If 'quick , both yes-or-no-p and y-or-n-p will work like y-or-n-p
  ;; If 'verbose , both yes-or-no-p and y-or-n-p will work like yes-or-no-p

  ;; yes-or-no-p now implemented in elisp instead of C
  (defun yes-or-no-p (prompt)
    (if (eq yes-or-no-option 'quick)
        (message "y/n")
      (message "yes/no")))

  ;; y-or-n-p redefined
  (defun y-or-n-p (prompt)
    (let* ((orig--yes-or-no-option yes-or-no-option)
           (yes-or-no-option (if (eq orig--yes-or-no-option 'verbose)
                                 'verbose
                               'quick)))
      (yes-or-no-p prompt)))

  (message "yes-or-no-p:")
  (yes-or-no-p "Q? ")
  (message "y-or-n-p:")
  (y-or-n-p "Q? ")
  nil)

On Fri, Sep 4, 2015 at 2:50 PM David Kastrup <dak@gnu.org> wrote:

> Eli Zaretskii <eliz@gnu.org> writes:
>
> >> From: David Kastrup <dak@gnu.org>
> >> Cc: Alan Mackenzie <acm@muc.de>, kaushal.modi@gmail.com,
> >> bruce.connor.am@gmail.com, emacs-devel@gnu.org,
> >> schwab@linux-m68k.org, monnier@iro.umontreal.ca, dgutov@yandex.ru,
> >> drew.adams@oracle.com
> >> Date: Fri, 04 Sep 2015 20:14:51 +0200
> >>
> >> Eli Zaretskii <eliz@gnu.org> writes:
> >>
> >> > The intent is to provide a predicate defcustom that allows to cause
> >> > yes-or-no-p behave like y-or-n-p.  y-or-n-p will always behave as it
> >> > does, and I didn't intend to change that, as I don't see the use case
> >> > for that.
> >>
> >> Reliable translation into selection boxes when feeding emacs -batch from
> >> a script?
> >
> > y-or-n-p already does TRT in that case (no dialog boxes in -batch).
>
> Feeding emacs -batch _from_ a script.  Meaning the script supplies "yes"
> and "no".
>
> >> Predictable behavior when navigating Emacs by voice?
> >
> > I don't see the relevance, please elaborate.
>
> Same as above.  External input translated into a source for consumption
> by Emacs.
>
> >> Some people may prefer saying "yes" to saying "why".
> >
> > Likewise.
>
> "why" is phonetically the same as "y".  Which means that it's likely
> harder to generate just "y" from voice than "yes".
>
> --
> David Kastrup
>

[-- Attachment #2: Type: text/html, Size: 4130 bytes --]

  reply	other threads:[~2015-09-04 18:52 UTC|newest]

Thread overview: 70+ 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
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 [this message]
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:54     ` 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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAFyQvY16cvLey9j-4r-37pgy67G5ETQg6hLzhfw8M5jSJnze8g@mail.gmail.com \
    --to=kaushal.modi@gmail.com \
    --cc=acm@muc.de \
    --cc=bruce.connor.am@gmail.com \
    --cc=dak@gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=drew.adams@oracle.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=schwab@linux-m68k.org \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).