Commit 0208ede7 authored by Juri Linkov's avatar Juri Linkov
Browse files

* 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
parent 5db9dace
2013-04-27 Juri Linkov <juri@jurta.org>
* subr.el (read-number): Doc fix about using it by interactive
code letter `n'. (Bug#14254)
2013-04-27 Juri Linkov <juri@jurta.org>
* desktop.el (desktop-auto-save-timeout): New option.
......
......@@ -2200,11 +2200,11 @@ by doing (clear-string STRING)."
;; And of course, don't keep the sensitive data around.
(erase-buffer))))))))
;; This should be used by `call-interactively' for `n' specs.
(defun read-number (prompt &optional default)
"Read a numeric value in the minibuffer, prompting with PROMPT.
DEFAULT specifies a default value to return if the user just types RET.
The value of DEFAULT is inserted into PROMPT."
The value of DEFAULT is inserted into PROMPT.
This function is used by the `interactive' code letter `n'."
(let ((n nil)
(default1 (if (consp default) (car default) default)))
(when default1
......
2013-04-27 Juri Linkov <juri@jurta.org>
* callint.c (Fcall_interactively): Call `Qread_number' for
interactive code letter `n' instead of using duplicate code.
(Bug#14254)
2013-04-27 Paul Eggert <eggert@cs.ucla.edu>
* systime.h (make_timeval): Declare as 'const'.
......
......@@ -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");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment