diff options
| author | Karl Heuer | 1995-06-07 22:18:05 +0000 |
|---|---|---|
| committer | Karl Heuer | 1995-06-07 22:18:05 +0000 |
| commit | d8bcf58ebc6d2a7ef91cca9d0fe35dabc5a796e2 (patch) | |
| tree | 8978380673e7f304ce2d011d44d3907874228e0a /src | |
| parent | 1e0c5826c5f701b1b1a46e7af702ed2e149df648 (diff) | |
| download | emacs-d8bcf58ebc6d2a7ef91cca9d0fe35dabc5a796e2.tar.gz emacs-d8bcf58ebc6d2a7ef91cca9d0fe35dabc5a796e2.zip | |
(cmd_error, command_loop_1, Fcommand_execute)
(Fexecute_extended_command, init_kboard, syms_of_keyboard):
Undo Feb 28 change; prefix arg handling is now in Lisp code again.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 46 |
1 files changed, 11 insertions, 35 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index c4e44ba9e5e..5556e3d18be 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -282,7 +282,6 @@ Lisp_Object Qself_insert_command; | |||
| 282 | Lisp_Object Qforward_char; | 282 | Lisp_Object Qforward_char; |
| 283 | Lisp_Object Qbackward_char; | 283 | Lisp_Object Qbackward_char; |
| 284 | Lisp_Object Qundefined; | 284 | Lisp_Object Qundefined; |
| 285 | Lisp_Object Qdigit_argument, Qnegative_argument; | ||
| 286 | 285 | ||
| 287 | /* read_key_sequence stores here the command definition of the | 286 | /* read_key_sequence stores here the command definition of the |
| 288 | key sequence that it reads. */ | 287 | key sequence that it reads. */ |
| @@ -835,7 +834,7 @@ cmd_error (data) | |||
| 835 | Vstandard_output = Qt; | 834 | Vstandard_output = Qt; |
| 836 | Vstandard_input = Qt; | 835 | Vstandard_input = Qt; |
| 837 | Vexecuting_macro = Qnil; | 836 | Vexecuting_macro = Qnil; |
| 838 | clear_prefix_arg (); | 837 | current_kboard->Vprefix_arg = Qnil; |
| 839 | cancel_echoing (); | 838 | cancel_echoing (); |
| 840 | 839 | ||
| 841 | /* Avoid unquittable loop if data contains a circular list. */ | 840 | /* Avoid unquittable loop if data contains a circular list. */ |
| @@ -1190,16 +1189,6 @@ command_loop_1 () | |||
| 1190 | last_point_position = PT; | 1189 | last_point_position = PT; |
| 1191 | XSETBUFFER (last_point_position_buffer, prev_buffer); | 1190 | XSETBUFFER (last_point_position_buffer, prev_buffer); |
| 1192 | 1191 | ||
| 1193 | /* If we're building a prefix argument, override minus and digits. */ | ||
| 1194 | if (current_kboard->prefix_partial && i == 1 && NATNUMP (keybuf[0])) | ||
| 1195 | { | ||
| 1196 | if (XFASTINT (keybuf[0]) == '-' | ||
| 1197 | && NILP (current_kboard->prefix_value)) | ||
| 1198 | cmd = Qnegative_argument; | ||
| 1199 | else if (XFASTINT (keybuf[0]) >= '0' && XFASTINT (keybuf[0]) <= '9') | ||
| 1200 | cmd = Qdigit_argument; | ||
| 1201 | } | ||
| 1202 | |||
| 1203 | /* Execute the command. */ | 1192 | /* Execute the command. */ |
| 1204 | 1193 | ||
| 1205 | this_command = cmd; | 1194 | this_command = cmd; |
| @@ -1214,15 +1203,11 @@ command_loop_1 () | |||
| 1214 | bitch_at_user (); | 1203 | bitch_at_user (); |
| 1215 | current_kboard->defining_kbd_macro = Qnil; | 1204 | current_kboard->defining_kbd_macro = Qnil; |
| 1216 | update_mode_lines = 1; | 1205 | update_mode_lines = 1; |
| 1217 | clear_prefix_arg (); | 1206 | current_kboard->Vprefix_arg = Qnil; |
| 1218 | } | 1207 | } |
| 1219 | else | 1208 | else |
| 1220 | { | 1209 | { |
| 1221 | current_prefix_partial = current_kboard->prefix_partial; | 1210 | if (NILP (current_kboard->Vprefix_arg) && ! no_direct) |
| 1222 | if (current_kboard->prefix_partial) | ||
| 1223 | finalize_prefix_arg (); | ||
| 1224 | |||
| 1225 | if (NILP (Vprefix_arg) && ! no_direct) | ||
| 1226 | { | 1211 | { |
| 1227 | /* Recognize some common commands in common situations and | 1212 | /* Recognize some common commands in common situations and |
| 1228 | do them directly. */ | 1213 | do them directly. */ |
| @@ -1345,7 +1330,7 @@ command_loop_1 () | |||
| 1345 | /* Here for a command that isn't executed directly */ | 1330 | /* Here for a command that isn't executed directly */ |
| 1346 | 1331 | ||
| 1347 | nonundocount = 0; | 1332 | nonundocount = 0; |
| 1348 | if (NILP (Vprefix_arg)) | 1333 | if (NILP (current_kboard->Vprefix_arg)) |
| 1349 | Fundo_boundary (); | 1334 | Fundo_boundary (); |
| 1350 | Fcommand_execute (this_command, Qnil); | 1335 | Fcommand_execute (this_command, Qnil); |
| 1351 | 1336 | ||
| @@ -1369,7 +1354,7 @@ command_loop_1 () | |||
| 1369 | 3) we want to leave this_command_key_count non-zero, so that | 1354 | 3) we want to leave this_command_key_count non-zero, so that |
| 1370 | read_char will realize that it is re-reading a character, and | 1355 | read_char will realize that it is re-reading a character, and |
| 1371 | not echo it a second time. */ | 1356 | not echo it a second time. */ |
| 1372 | if (NILP (Vprefix_arg) && !current_kboard->prefix_partial) | 1357 | if (NILP (current_kboard->Vprefix_arg)) |
| 1373 | { | 1358 | { |
| 1374 | last_command = this_command; | 1359 | last_command = this_command; |
| 1375 | cancel_echoing (); | 1360 | cancel_echoing (); |
| @@ -1390,8 +1375,8 @@ command_loop_1 () | |||
| 1390 | finalize: | 1375 | finalize: |
| 1391 | /* Install chars successfully executed in kbd macro. */ | 1376 | /* Install chars successfully executed in kbd macro. */ |
| 1392 | 1377 | ||
| 1393 | if (!NILP (current_kboard->defining_kbd_macro) && NILP (Vprefix_arg) | 1378 | if (!NILP (current_kboard->defining_kbd_macro) |
| 1394 | && !current_kboard->prefix_partial) | 1379 | && NILP (current_kboard->Vprefix_arg)) |
| 1395 | finalize_kbd_macro_chars (); | 1380 | finalize_kbd_macro_chars (); |
| 1396 | 1381 | ||
| 1397 | #ifdef MULTI_KBOARD | 1382 | #ifdef MULTI_KBOARD |
| @@ -5983,8 +5968,8 @@ Otherwise, that is done only if an arg is read using the minibuffer.") | |||
| 5983 | struct backtrace backtrace; | 5968 | struct backtrace backtrace; |
| 5984 | extern int debug_on_next_call; | 5969 | extern int debug_on_next_call; |
| 5985 | 5970 | ||
| 5986 | prefixarg = Vprefix_arg; | 5971 | prefixarg = current_kboard->Vprefix_arg; |
| 5987 | clear_prefix_arg (); | 5972 | current_kboard->Vprefix_arg = Qnil; |
| 5988 | Vcurrent_prefix_arg = prefixarg; | 5973 | Vcurrent_prefix_arg = prefixarg; |
| 5989 | debug_on_next_call = 0; | 5974 | debug_on_next_call = 0; |
| 5990 | 5975 | ||
| @@ -6115,7 +6100,7 @@ DEFUN ("execute-extended-command", Fexecute_extended_command, Sexecute_extended_ | |||
| 6115 | UNGCPRO; | 6100 | UNGCPRO; |
| 6116 | 6101 | ||
| 6117 | function = Fintern (function, Qnil); | 6102 | function = Fintern (function, Qnil); |
| 6118 | Vprefix_arg = prefixarg; | 6103 | current_kboard->Vprefix_arg = prefixarg; |
| 6119 | this_command = function; | 6104 | this_command = function; |
| 6120 | 6105 | ||
| 6121 | return Fcommand_execute (function, Qt); | 6106 | return Fcommand_execute (function, Qt); |
| @@ -6601,10 +6586,7 @@ void | |||
| 6601 | init_kboard (kb) | 6586 | init_kboard (kb) |
| 6602 | KBOARD *kb; | 6587 | KBOARD *kb; |
| 6603 | { | 6588 | { |
| 6604 | kb->prefix_factor = Qnil; | 6589 | kb->Vprefix_arg = Qnil; |
| 6605 | kb->prefix_value = Qnil; | ||
| 6606 | kb->prefix_sign = 1; | ||
| 6607 | kb->prefix_partial = 0; | ||
| 6608 | kb->kbd_queue = Qnil; | 6590 | kb->kbd_queue = Qnil; |
| 6609 | kb->kbd_queue_has_data = 0; | 6591 | kb->kbd_queue_has_data = 0; |
| 6610 | kb->immediate_echo = 0; | 6592 | kb->immediate_echo = 0; |
| @@ -6762,12 +6744,6 @@ syms_of_keyboard () | |||
| 6762 | Qundefined = intern ("undefined"); | 6744 | Qundefined = intern ("undefined"); |
| 6763 | staticpro (&Qundefined); | 6745 | staticpro (&Qundefined); |
| 6764 | 6746 | ||
| 6765 | Qdigit_argument = intern ("digit-argument"); | ||
| 6766 | staticpro (&Qdigit_argument); | ||
| 6767 | |||
| 6768 | Qnegative_argument = intern ("negative-argument"); | ||
| 6769 | staticpro (&Qnegative_argument); | ||
| 6770 | |||
| 6771 | Qpre_command_hook = intern ("pre-command-hook"); | 6747 | Qpre_command_hook = intern ("pre-command-hook"); |
| 6772 | staticpro (&Qpre_command_hook); | 6748 | staticpro (&Qpre_command_hook); |
| 6773 | 6749 | ||