unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
       [not found] <E1PbGtF-0005Ln-Jb@internal.in.savannah.gnu.org>
@ 2011-01-13 14:27 ` Katsumi Yamaoka
  2011-01-13 17:39   ` Chong Yidong
  2011-01-13 20:54   ` Stefan Monnier
  0 siblings, 2 replies; 11+ messages in thread
From: Katsumi Yamaoka @ 2011-01-13 14:27 UTC (permalink / raw)
  To: Chong Yidong; +Cc: emacs-devel, wl-en

>   * lisp/subr.el (y-or-n-p): Accept format string args.
>   * src/fns.c (Fyes_or_no_p): Accept format string args.

So, how do we write a Lisp source program that is for various
Emacs versions, and that uses `y-or-n-p' or `yes-or-no-p' like
the following?  (Please try evaluating it.)

(y-or-n-p "Is it 100% ok? ")

It's no more than an example; a prompt string may be the one that
a fickle program generates.

(y-or-n-p "Is it 100%% ok? ")

is not a solution because it's bad for Emacs 23 and earlier (and
XEmacs).  Taiji Can reported in the wl list that Wanderlust causes
an error recently as follows:

> Debugger entered--Lisp error: (error "Not enough arguments for format string")
[...]
>   y-or-n-p("Execute marks in %INBOX:username/clear@mailserver:143!!? (answer \"n\" to discard them) ")

Where "%INBOX:..." is a mail folder name that Wanderlust uses.
I think we can't help reverting it.

Regards,



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 14:27 ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Katsumi Yamaoka
@ 2011-01-13 17:39   ` Chong Yidong
  2011-01-13 18:38     ` Andreas Schwab
  2011-01-14  1:54     ` Richard Stallman
  2011-01-13 20:54   ` Stefan Monnier
  1 sibling, 2 replies; 11+ messages in thread
From: Chong Yidong @ 2011-01-13 17:39 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: wl-en, emacs-devel

Katsumi Yamaoka <yamaoka@jpl.org> writes:

>>   * lisp/subr.el (y-or-n-p): Accept format string args.
>>   * src/fns.c (Fyes_or_no_p): Accept format string args.
>
> So, how do we write a Lisp source program that is for various
> Emacs versions, and that uses `y-or-n-p' or `yes-or-no-p' like
> the following?  (Please try evaluating it.)
>
> (y-or-n-p "Is it 100% ok? ")

Good point.  For compatibility, probably we should fall back on the old
behavior if only one argument is supplied.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 17:39   ` Chong Yidong
@ 2011-01-13 18:38     ` Andreas Schwab
  2011-01-13 18:53       ` Chong Yidong
  2011-01-14  1:54     ` Richard Stallman
  1 sibling, 1 reply; 11+ messages in thread
From: Andreas Schwab @ 2011-01-13 18:38 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Katsumi Yamaoka, wl-en, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Good point.  For compatibility, probably we should fall back on the old
> behavior if only one argument is supplied.

What's wrong with explicitly using format?

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."



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 18:38     ` Andreas Schwab
@ 2011-01-13 18:53       ` Chong Yidong
  2011-01-13 19:02         ` Andreas Schwab
  0 siblings, 1 reply; 11+ messages in thread
From: Chong Yidong @ 2011-01-13 18:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Katsumi Yamaoka, wl-en, emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> What's wrong with explicitly using format?

Same reason as `message' and `error'.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 18:53       ` Chong Yidong
@ 2011-01-13 19:02         ` Andreas Schwab
  2011-01-13 19:14           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-pand yes-or-no-p Drew Adams
  2011-01-13 19:53           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Chong Yidong
  0 siblings, 2 replies; 11+ messages in thread
From: Andreas Schwab @ 2011-01-13 19:02 UTC (permalink / raw)
  To: Chong Yidong; +Cc: Katsumi Yamaoka, wl-en, emacs-devel

Chong Yidong <cyd@stupidchicken.com> writes:

> Andreas Schwab <schwab@linux-m68k.org> writes:
>
>> What's wrong with explicitly using format?
>
> Same reason as `message' and `error'.

That does not answer my question.  Why could yes-or-no-p live without
format for more than 20 years?

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."



^ permalink raw reply	[flat|nested] 11+ messages in thread

* RE: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-pand yes-or-no-p.
  2011-01-13 19:02         ` Andreas Schwab
@ 2011-01-13 19:14           ` Drew Adams
  2011-01-13 19:53           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Chong Yidong
  1 sibling, 0 replies; 11+ messages in thread
From: Drew Adams @ 2011-01-13 19:14 UTC (permalink / raw)
  To: 'Andreas Schwab', 'Chong Yidong'
  Cc: 'Katsumi Yamaoka', wl-en, emacs-devel

> >> What's wrong with explicitly using format?
> > Same reason as `message' and `error'.
> That does not answer my question.  Why could yes-or-no-p live without
> format for more than 20 years?

1+  YAGNI.




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 19:02         ` Andreas Schwab
  2011-01-13 19:14           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-pand yes-or-no-p Drew Adams
@ 2011-01-13 19:53           ` Chong Yidong
  1 sibling, 0 replies; 11+ messages in thread
From: Chong Yidong @ 2011-01-13 19:53 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Katsumi Yamaoka, wl-en, emacs-devel

Andreas Schwab <schwab@linux-m68k.org> writes:

> Why could yes-or-no-p live without format for more than 20 years?

Presumably because no one bothered to change it.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 14:27 ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Katsumi Yamaoka
  2011-01-13 17:39   ` Chong Yidong
@ 2011-01-13 20:54   ` Stefan Monnier
  1 sibling, 0 replies; 11+ messages in thread
From: Stefan Monnier @ 2011-01-13 20:54 UTC (permalink / raw)
  To: Katsumi Yamaoka; +Cc: Chong Yidong, wl-en, emacs-devel

> I think we can't help reverting it.

I tend to agree.  It doesn't seem important enough.


        Stefan



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-13 17:39   ` Chong Yidong
  2011-01-13 18:38     ` Andreas Schwab
@ 2011-01-14  1:54     ` Richard Stallman
  2011-01-20  2:59       ` Chong Yidong
  1 sibling, 1 reply; 11+ messages in thread
From: Richard Stallman @ 2011-01-14  1:54 UTC (permalink / raw)
  To: Chong Yidong; +Cc: yamaoka, wl-en, emacs-devel

    Good point.  For compatibility, probably we should fall back on the old
    behavior if only one argument is supplied.

That will work in practice, but it is kludgy and ugly.  That is why I
didn't do this.  I regret that I did not initially made y-or-n-p and
yes-or-no-p use format.

Maybe the thing is to add two new functions which are similar
but always call format.
 
-- 
Richard Stallman
President, Free Software Foundation
51 Franklin St
Boston MA 02110
USA
www.fsf.org, www.gnu.org



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-14  1:54     ` Richard Stallman
@ 2011-01-20  2:59       ` Chong Yidong
  2011-01-20  5:58         ` Katsumi Yamaoka
  0 siblings, 1 reply; 11+ messages in thread
From: Chong Yidong @ 2011-01-20  2:59 UTC (permalink / raw)
  To: rms; +Cc: yamaoka, wl-en, emacs-devel

Richard Stallman <rms@gnu.org> writes:

>     Good point.  For compatibility, probably we should fall back on the old
>     behavior if only one argument is supplied.
>
> That will work in practice, but it is kludgy and ugly.  That is why I
> didn't do this.  I regret that I did not initially made y-or-n-p and
> yes-or-no-p use format.

Fair enough; I reverted the change.

> Maybe the thing is to add two new functions which are similar
> but always call format.

Probably not worth it, unless a much more concise set of function names
is offered.  I guess we'll have to live with this unfortunate historical
accident.



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p.
  2011-01-20  2:59       ` Chong Yidong
@ 2011-01-20  5:58         ` Katsumi Yamaoka
  0 siblings, 0 replies; 11+ messages in thread
From: Katsumi Yamaoka @ 2011-01-20  5:58 UTC (permalink / raw)
  To: Chong Yidong; +Cc: rms, yamaoka, wl-en, emacs-devel

Chong Yidong <cyd@stupidchicken.com> wrote:
> Fair enough; I reverted the change.

Thank you!



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-01-20  5:58 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1PbGtF-0005Ln-Jb@internal.in.savannah.gnu.org>
2011-01-13 14:27 ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Katsumi Yamaoka
2011-01-13 17:39   ` Chong Yidong
2011-01-13 18:38     ` Andreas Schwab
2011-01-13 18:53       ` Chong Yidong
2011-01-13 19:02         ` Andreas Schwab
2011-01-13 19:14           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-pand yes-or-no-p Drew Adams
2011-01-13 19:53           ` /srv/bzr/emacs/trunk r102775: Allow format args for y-or-n-p and yes-or-no-p Chong Yidong
2011-01-14  1:54     ` Richard Stallman
2011-01-20  2:59       ` Chong Yidong
2011-01-20  5:58         ` Katsumi Yamaoka
2011-01-13 20:54   ` Stefan Monnier

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).