From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kaushal Modi Newsgroups: gmane.emacs.devel Subject: Re: yes-or-no-p prompt conditionally broken in master? Date: Fri, 04 Sep 2015 12:59:14 +0000 Message-ID: References: <83k2s7a247.fsf@gnu.org> <55E88336.5060703@yandex.ru> <83h9nb9z5l.fsf@gnu.org> <55E8879B.9050107@yandex.ru> <83fv2v9y9z.fsf@gnu.org> <57355235-9af7-49fb-81b5-93182cfc9d49@default> <83a8t39x3t.fsf@gnu.org> <83zj128slp.fsf@gnu.org> <87k2s6o7qh.fsf@igel.home> <83wpw68j2n.fsf@gnu.org> <871teenysf.fsf@igel.home> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c2ef9a1739a5051eeb7852 X-Trace: ger.gmane.org 1441371602 19838 80.91.229.3 (4 Sep 2015 13:00:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 4 Sep 2015 13:00:02 +0000 (UTC) Cc: drew.adams@oracle.com, emacs-devel@gnu.org, monnier@iro.umontreal.ca, bruce.connor.am@gmail.com, dgutov@yandex.ru To: Andreas Schwab , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Sep 04 15:00:00 2015 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZXqb1-0001Eb-6D for ged-emacs-devel@m.gmane.org; Fri, 04 Sep 2015 14:59:59 +0200 Original-Received: from localhost ([::1]:58914 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqb1-0006qx-Ci for ged-emacs-devel@m.gmane.org; Fri, 04 Sep 2015 08:59:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:51556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqak-0006pj-Rw for emacs-devel@gnu.org; Fri, 04 Sep 2015 08:59:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXqaj-0000UE-N9 for emacs-devel@gnu.org; Fri, 04 Sep 2015 08:59:42 -0400 Original-Received: from mail-ob0-x22c.google.com ([2607:f8b0:4003:c01::22c]:33027) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXqai-0000R1-0I; Fri, 04 Sep 2015 08:59:40 -0400 Original-Received: by obbbh8 with SMTP id bh8so16044426obb.0; Fri, 04 Sep 2015 05:59:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-type; bh=2nXHyajTCxBvij4ikHI7W0N149r+R1iiLBGBzGbym70=; b=ZioBSTOgfG/icTNLIXvY3SPObDHgi2Xt8Kw/yzQqxxLfLNvv4/IJ5EewZnwk4FWTOK zFzmgydj2jTv5m/+3YKFlsjplFWRbLxjTLI/Pqz9OPZvDd3kBx5ohqbYRUxr7I7zB2uU GzUX7LQiN2Ia+Bcl3d3OhLP5555Pbp5m78df1NnsIuCS7sznvVFc0U+fCp0ZWb4F2A6x yUjMyayBiwBXsLbZCQkEuKP9MQbly1ZLxuWHyPstux6afox3n65I1t5yOR52/lDTWAkV g5+hTKVBGxvOlbUguaG0zeylmWm6s354YHTqcgM2xGfwo45dJy7UpfeLERIjK7V2KDoQ djXA== X-Received: by 10.182.246.101 with SMTP id xv5mr2841915obc.5.1441371564486; Fri, 04 Sep 2015 05:59:24 -0700 (PDT) In-Reply-To: <871teenysf.fsf@igel.home> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c01::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:189588 Archived-At: --001a11c2ef9a1739a5051eeb7852 Content-Type: text/plain; charset=UTF-8 > Well, we could have one function bind the defcustom and then call the other one. Then we won't even need a defalias for backward compatibility. That's awesome! So I believe it will be something like this? (defcustom yes-or-no-quick nil) ;; yes-or-no-p now implemented in elisp instead of C (defun yes-or-no-p (prompt) (if yes-or-no-p-quick (progn ;; y-or-n-p implementation ) (progn ;; legacy yes-or-no-p implementation ))) ;; y-or-n-p redefined (defun y-or-n-p (prompt) (let ((yes-or-no-quick t)) (yes-or-no-p prompt))) On Fri, Sep 4, 2015 at 8:40 AM Andreas Schwab wrote: > Eli Zaretskii writes: > > >> From: Andreas Schwab > >> Cc: bruce.connor.am@gmail.com, kaushal.modi@gmail.com, > dgutov@yandex.ru, monnier@iro.umontreal.ca, drew.adams@oracle.com, > emacs-devel@gnu.org > >> Date: Fri, 04 Sep 2015 11:26:46 +0200 > >> > >> Eli Zaretskii 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. > > > > Sorry, I lost you: what different meaning is that? > > (elisp) Yes-or-No Queries > > Andreas. > > -- > Andreas Schwab, schwab@linux-m68k.org > GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 > "And now for something completely different." > --001a11c2ef9a1739a5051eeb7852 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
>=C2=A0Well, we could have one function bind the defcustom and then call = the
other o= ne.=C2=A0 Then we won't even need a defalias for backward
compatibility.

That's awesome! So I believe it will be something= like this?

<psuedocode follows>

(defcustom yes-or-no-quick nil)
;; yes-or-no-p now implemented in elisp instead of C
(defun yes-= or-no-p (prompt)
=C2=A0 (if yes-or-no-p-quick
=C2=A0 = =C2=A0 =C2=A0 (progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0;; y-or-n-= p implementation
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0)
= =C2=A0 =C2=A0 =C2=A0(progn
=C2=A0 =C2=A0 =C2=A0 =C2=A0 ;; legacy = yes-or-no-p implementation
=C2=A0 =C2=A0 =C2=A0 =C2=A0 )))
<= div>
;; y-or-n-p redefined
(defun y-or-n-p (prompt)=
=C2=A0 (let ((yes-or-no-quick t))
=C2=A0 =C2=A0 =C2=A0= (yes-or-no-p prompt)))



On Fri, Sep 4, 2015 at 8:40 AM Andreas = Schwab <schwab@linux-m68k.org> wrote:
Eli Zaretskii <eliz@gnu.org> writes:=

>> From: Andreas Schwab <schwab@linux-m68k.org>
>> Cc: bruce.connor.am@gmail.com,=C2=A0 kaushal.modi@gmail.com,=C2=A0 dgutov@yandex.ru,=C2=A0 monnier@iro.umontreal.ca= ,=C2=A0 drew= .adams@oracle.com,=C2=A0 emacs-devel@gnu.org
>> Date: Fri, 04 Sep 2015 11:26:46 +0200
>>
>> Eli Zaretskii <eliz@gnu.org> writes:
>>
>> > Any objections to removing yes-or-no-p (with a defalias for b= ackward
>> > compatibility, of course) and making y-or-n-p serve both duti= es,
>> > controlled by some defcustom?
>>
>> That doesn't make sense.=C2=A0 They implement different intent= ed meaning.
>
> Sorry, I lost you: what different meaning is that?

(elisp) Yes-or-No Queries

Andreas.

--
Andreas Schwab, = schwab@linux-m68k.org
GPG Key fingerprint =3D 58CA 54C7 6D53 942B 1756=C2=A0 01D3 44D5 214B 8276 = 4ED5
"And now for something completely different."
--001a11c2ef9a1739a5051eeb7852--