diff options
| author | Juri Linkov | 2013-04-28 00:12:17 +0300 |
|---|---|---|
| committer | Juri Linkov | 2013-04-28 00:12:17 +0300 |
| commit | 0208ede7abd03f6945fd3b6c18e7d089096b2d79 (patch) | |
| tree | 7fa36e5c559f6851e6030b49b30fe927463c2447 /src/callint.c | |
| parent | 5db9dace2dad8407dd9267513cf73e8688ee2ad7 (diff) | |
| download | emacs-0208ede7abd03f6945fd3b6c18e7d089096b2d79.tar.gz emacs-0208ede7abd03f6945fd3b6c18e7d089096b2d79.zip | |
* 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.c | 26 |
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; | |||
| 34 | static Lisp_Object Qenable_recursive_minibuffers; | 34 | static Lisp_Object Qenable_recursive_minibuffers; |
| 35 | 35 | ||
| 36 | static Lisp_Object Qhandle_shift_selection; | 36 | static Lisp_Object Qhandle_shift_selection; |
| 37 | static Lisp_Object Qread_number; | ||
| 37 | 38 | ||
| 38 | Lisp_Object Qmouse_leave_buffer_hook; | 39 | Lisp_Object Qmouse_leave_buffer_hook; |
| 39 | 40 | ||
| @@ -683,29 +684,7 @@ invoke it. If KEYS is omitted or nil, the return value of | |||
| 683 | if (!NILP (prefix_arg)) | 684 | if (!NILP (prefix_arg)) |
| 684 | goto have_prefix_arg; | 685 | goto have_prefix_arg; |
| 685 | case 'n': /* Read number from minibuffer. */ | 686 | case 'n': /* Read number from minibuffer. */ |
| 686 | { | 687 | args[i] = call1 (Qread_number, callint_message); |
| 687 | bool first = 1; | ||
| 688 | do | ||
| 689 | { | ||
| 690 | Lisp_Object str; | ||
| 691 | if (! first) | ||
| 692 | { | ||
| 693 | message1 ("Please enter a number."); | ||
| 694 | sit_for (make_number (1), 0, 0); | ||
| 695 | } | ||
| 696 | first = 0; | ||
| 697 | |||
| 698 | str = Fread_from_minibuffer (callint_message, | ||
| 699 | Qnil, Qnil, Qnil, Qnil, Qnil, | ||
| 700 | Qnil); | ||
| 701 | if (! STRINGP (str) || SCHARS (str) == 0) | ||
| 702 | args[i] = Qnil; | ||
| 703 | else | ||
| 704 | args[i] = Fread (str); | ||
| 705 | } | ||
| 706 | while (! NUMBERP (args[i])); | ||
| 707 | } | ||
| 708 | visargs[i] = args[i]; | ||
| 709 | break; | 688 | break; |
| 710 | 689 | ||
| 711 | case 'P': /* Prefix arg in raw form. Does no I/O. */ | 690 | case 'P': /* Prefix arg in raw form. Does no I/O. */ |
| @@ -903,6 +882,7 @@ syms_of_callint (void) | |||
| 903 | DEFSYM (Qminus, "-"); | 882 | DEFSYM (Qminus, "-"); |
| 904 | DEFSYM (Qplus, "+"); | 883 | DEFSYM (Qplus, "+"); |
| 905 | DEFSYM (Qhandle_shift_selection, "handle-shift-selection"); | 884 | DEFSYM (Qhandle_shift_selection, "handle-shift-selection"); |
| 885 | DEFSYM (Qread_number, "read-number"); | ||
| 906 | DEFSYM (Qcall_interactively, "call-interactively"); | 886 | DEFSYM (Qcall_interactively, "call-interactively"); |
| 907 | DEFSYM (Qcommand_debug_status, "command-debug-status"); | 887 | DEFSYM (Qcommand_debug_status, "command-debug-status"); |
| 908 | DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); | 888 | DEFSYM (Qenable_recursive_minibuffers, "enable-recursive-minibuffers"); |