summaryrefslogtreecommitdiff
path: root/src/callint.c
diff options
context:
space:
mode:
authorJuri Linkov <juri@jurta.org>2013-04-28 00:12:17 +0300
committerJuri Linkov <juri@jurta.org>2013-04-28 00:12:17 +0300
commit0208ede7abd03f6945fd3b6c18e7d089096b2d79 (patch)
tree7fa36e5c559f6851e6030b49b30fe927463c2447 /src/callint.c
parent5db9dace2dad8407dd9267513cf73e8688ee2ad7 (diff)
downloademacs-0208ede7abd03f6945fd3b6c18e7d089096b2d79.tar.gz
* src/callint.c (Fcall_interactively): Call `Qread_number' for
interactive code letter `n' instead of using duplicate code. * lisp/subr.el (read-number): Doc fix about using it by interactive code letter `n'. Fixes: debbugs:14254
Diffstat (limited to 'src/callint.c')
-rw-r--r--src/callint.c26
1 files changed, 3 insertions, 23 deletions
diff --git a/src/callint.c b/src/callint.c
index 212dd2e3d62..940ff3ed249 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -34,6 +34,7 @@ static Lisp_Object Qcommand_debug_status;
static Lisp_Object Qenable_recursive_minibuffers;
static Lisp_Object Qhandle_shift_selection;
+static Lisp_Object Qread_number;
Lisp_Object Qmouse_leave_buffer_hook;
@@ -683,29 +684,7 @@ invoke it. If KEYS is omitted or nil, the return value of
if (!NILP (prefix_arg))
goto have_prefix_arg;
case 'n': /* Read number from minibuffer. */
- {
- bool first = 1;
- do
- {
- Lisp_Object str;
- if (! first)
- {
- message1 ("Please enter a number.");
- sit_for (make_number (1), 0, 0);
- }
- first = 0;
-
- str = Fread_from_minibuffer (callint_message,
- Qnil, Qnil, Qnil, Qnil, Qnil,
- Qnil);
- if (! STRINGP (str) || SCHARS (str) == 0)
- args[i] = Qnil;
- else
- args[i] = Fread (str);
- }
- while (! NUMBERP (args[i]));
- }
- visargs[i] = args[i];
+ args[i] = call1 (Qread_number, callint_message);
break;
case 'P': /* Prefix arg in raw form. Does no I/O. */
@@ -903,6 +882,7 @@ syms_of_callint (void)
DEFSYM (Qminus, "-");
DEFSYM (Qplus, "+");
DEFSYM (Qhandle_shift_selection, "handle-shift-selection");
+ DEFSYM (Qread_number, "read-number");
DEFSYM (Qcall_interactively, "call-interactively");
DEFSYM (Qcommand_debug_status, "command-debug-status");
DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers");