diff options
| author | Eli Zaretskii | 2013-05-01 20:47:50 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2013-05-01 20:47:50 +0300 |
| commit | b1cb82edff21abfefd68af18370dddfd8cc1fec0 (patch) | |
| tree | fd8d8a1e1d99af024b52158a471457fc796238bc /lisp/subr.el | |
| parent | 10f81f3ac90f98160f611787e20dcad96bb500e9 (diff) | |
| parent | 2640d52e4e7873e41b0f0f1144177f84c345917e (diff) | |
| download | emacs-b1cb82edff21abfefd68af18370dddfd8cc1fec0.tar.gz emacs-b1cb82edff21abfefd68af18370dddfd8cc1fec0.zip | |
Merge from trunk.
Diffstat (limited to 'lisp/subr.el')
| -rw-r--r-- | lisp/subr.el | 6 |
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. |
| 2206 | DEFAULT specifies a default value to return if the user just types RET. | 2205 | DEFAULT specifies a default value to return if the user just types RET. |
| 2207 | The value of DEFAULT is inserted into PROMPT." | 2206 | The value of DEFAULT is inserted into PROMPT. |
| 2207 | This 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.") |