+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.
;; 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'.
static Lisp_Object Qenable_recursive_minibuffers;
static Lisp_Object Qhandle_shift_selection;
+static Lisp_Object Qread_number;
Lisp_Object Qmouse_leave_buffer_hook;
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. */
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");