diff src/fns.c @ 112380:aa1e27e3a554

Revert changes adding format args to yes-or-no-p and y-or-n-p. See discussion on emacs-devel at http://lists.gnu.org/archive/html/emacs-devel/2011-01/msg00388.html * src/fns.c (Fyes_or_no_p): Revert 2011-01-07 change, removing ARGS. * lisp/subr.el (y-or-n-p): Revert 2011-01-07 change, removing ARGS. * lisp/files.el (find-alternate-file, basic-save-buffer) (basic-save-buffer-2, revert-buffer, recover-file) (kill-buffer-ask, abort-if-file-too-large) (set-visited-file-name, write-file, backup-buffer) (basic-save-buffer, save-some-buffers): * lisp/dired-aux.el (dired-compress-file): Callers changed.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 19 Jan 2011 21:55:36 -0500
parents 42e22c4f06b7
children
line wrap: on
line diff
--- a/src/fns.c	Wed Jan 19 15:59:52 2011 -0800
+++ b/src/fns.c	Wed Jan 19 21:55:36 2011 -0500
@@ -2450,24 +2450,23 @@
 
 /* Anything that calls this function must protect from GC!  */
 
-DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, MANY, 0,
+DEFUN ("yes-or-no-p", Fyes_or_no_p, Syes_or_no_p, 1, 1, 0,
        doc: /* Ask user a yes-or-no question.  Return t if answer is yes.
-The string to display to ask the question is obtained by
-formatting the string PROMPT with arguments ARGS (see `format').
-The result should end in a space; `yes-or-no-p' adds
-\"(yes or no) \" to it.
+PROMPT is the string to display to ask the question.  It should end in
+a space; `yes-or-no-p' adds \"(yes or no) \" to it.
 
 The user must confirm the answer with RET, and can edit it until it
 has been confirmed.
 
 Under a windowing system a dialog box will be used if `last-nonmenu-event'
-is nil, and `use-dialog-box' is non-nil.
-usage: (yes-or-no-p PROMPT &rest ARGS)  */)
-  (int nargs, Lisp_Object *args)
+is nil, and `use-dialog-box' is non-nil.  */)
+  (Lisp_Object prompt)
 {
   register Lisp_Object ans;
+  Lisp_Object args[2];
   struct gcpro gcpro1;
-  Lisp_Object prompt = Fformat (nargs, args);
+
+  CHECK_STRING (prompt);
 
 #ifdef HAVE_MENUS
   if (FRAME_WINDOW_P (SELECTED_FRAME ())
@@ -2488,7 +2487,10 @@
     }
 #endif /* HAVE_MENUS */
 
-  prompt = concat2 (prompt, build_string ("(yes or no) "));
+  args[0] = prompt;
+  args[1] = build_string ("(yes or no) ");
+  prompt = Fconcat (2, args);
+
   GCPRO1 (prompt);
 
   while (1)