comparison 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
comparison
equal deleted inserted replaced
112379:b14f98859016 112380:aa1e27e3a554
2065 (setq read (cons t read))) 2065 (setq read (cons t read)))
2066 (push read unread-command-events) 2066 (push read unread-command-events)
2067 nil)))))) 2067 nil))))))
2068 (set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1") 2068 (set-advertised-calling-convention 'sit-for '(seconds &optional nodisp) "22.1")
2069 2069
2070 (defun y-or-n-p (prompt &rest args) 2070 (defun y-or-n-p (prompt)
2071 "Ask user a \"y or n\" question. Return t if answer is \"y\". 2071 "Ask user a \"y or n\" question. Return t if answer is \"y\".
2072 The string to display to ask the question is obtained by 2072 PROMPT is the string to display to ask the question. It should
2073 formatting the string PROMPT with arguments ARGS (see `format'). 2073 end in a space; `y-or-n-p' adds \"(y or n) \" to it.
2074 The result should end in a space; `y-or-n-p' adds \"(y or n) \"
2075 to it.
2076 2074
2077 No confirmation of the answer is requested; a single character is enough. 2075 No confirmation of the answer is requested; a single character is enough.
2078 Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses 2076 Also accepts Space to mean yes, or Delete to mean no. \(Actually, it uses
2079 the bindings in `query-replace-map'; see the documentation of that variable 2077 the bindings in `query-replace-map'; see the documentation of that variable
2080 for more information. In this case, the useful bindings are `act', `skip', 2078 for more information. In this case, the useful bindings are `act', `skip',
2089 (if (and (display-popup-menus-p) 2087 (if (and (display-popup-menus-p)
2090 (listp last-nonmenu-event) 2088 (listp last-nonmenu-event)
2091 use-dialog-box) 2089 use-dialog-box)
2092 (setq answer 2090 (setq answer
2093 (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip)))) 2091 (x-popup-dialog t `(,prompt ("yes" . act) ("No" . skip))))
2094 (setq prompt (concat (apply 'format prompt args) 2092 (setq prompt (concat prompt
2095 (if (eq ?\s (aref prompt (1- (length prompt)))) 2093 (if (eq ?\s (aref prompt (1- (length prompt))))
2096 "" " ") 2094 "" " ")
2097 "(y or n) ")) 2095 "(y or n) "))
2098 (while 2096 (while
2099 (let* ((key 2097 (let* ((key