Mercurial > emacs
diff lisp/subr.el @ 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 | cc0887b67703 |
children | 9f7614f1a892 |
line wrap: on
line diff
--- a/lisp/subr.el Wed Jan 19 15:59:52 2011 -0800 +++ b/lisp/subr.el Wed Jan 19 21:55:36 2011 -0500 @@ -2067,12 +2067,10 @@ nil)))))) (set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1") -(defun y-or-n-p (prompt &rest args) +(defun y-or-n-p (prompt) "Ask user a \"y or n\" question. Return t if answer is \"y\". -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; `y-or-n-p' adds \"(y or n) \" -to it. +PROMPT is the string to display to ask the question. It should +end in a space; `y-or-n-p' adds \"(y or n) \" to it. No confirmation of the answer is requested; a single character is enough. Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses @@ -2091,7 +2089,7 @@ use-dialog-box) (setq answer (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip)))) - (setq prompt (concat (apply 'format prompt args) + (setq prompt (concat prompt (if (eq ?\s (aref prompt (1- (length prompt)))) "" " ") "(y or n) "))