aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/subr.el
diff options
context:
space:
mode:
authorEli Zaretskii2013-05-01 20:47:50 +0300
committerEli Zaretskii2013-05-01 20:47:50 +0300
commitb1cb82edff21abfefd68af18370dddfd8cc1fec0 (patch)
treefd8d8a1e1d99af024b52158a471457fc796238bc /lisp/subr.el
parent10f81f3ac90f98160f611787e20dcad96bb500e9 (diff)
parent2640d52e4e7873e41b0f0f1144177f84c345917e (diff)
downloademacs-b1cb82edff21abfefd68af18370dddfd8cc1fec0.tar.gz
emacs-b1cb82edff21abfefd68af18370dddfd8cc1fec0.zip
Merge from trunk.
Diffstat (limited to 'lisp/subr.el')
-rw-r--r--lisp/subr.el6
1 files changed, 3 insertions, 3 deletions
diff --git a/lisp/subr.el b/lisp/subr.el
index dc968542cd0..802fee4ee65 100644
--- a/lisp/subr.el
+++ b/lisp/subr.el
@@ -2200,11 +2200,11 @@ by doing (clear-string STRING)."
2200 ;; And of course, don't keep the sensitive data around. 2200 ;; And of course, don't keep the sensitive data around.
2201 (erase-buffer)))))))) 2201 (erase-buffer))))))))
2202 2202
2203;; This should be used by `call-interactively' for `n' specs.
2204(defun read-number (prompt &optional default) 2203(defun read-number (prompt &optional default)
2205 "Read a numeric value in the minibuffer, prompting with PROMPT. 2204 "Read a numeric value in the minibuffer, prompting with PROMPT.
2206DEFAULT specifies a default value to return if the user just types RET. 2205DEFAULT specifies a default value to return if the user just types RET.
2207The value of DEFAULT is inserted into PROMPT." 2206The value of DEFAULT is inserted into PROMPT.
2207This function is used by the `interactive' code letter `n'."
2208 (let ((n nil) 2208 (let ((n nil)
2209 (default1 (if (consp default) (car default) default))) 2209 (default1 (if (consp default) (car default) default)))
2210 (when default1 2210 (when default1
@@ -2225,7 +2225,7 @@ The value of DEFAULT is inserted into PROMPT."
2225 (condition-case nil 2225 (condition-case nil
2226 (setq n (cond 2226 (setq n (cond
2227 ((zerop (length str)) default1) 2227 ((zerop (length str)) default1)
2228 ((stringp str) (string-to-number str)))) 2228 ((stringp str) (read str))))
2229 (error nil))) 2229 (error nil)))
2230 (unless (numberp n) 2230 (unless (numberp n)
2231 (message "Please enter a number.") 2231 (message "Please enter a number.")