diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 18 | ||||
| -rw-r--r-- | src/macros.c | 30 | ||||
| -rw-r--r-- | src/macros.h | 6 |
3 files changed, 27 insertions, 27 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index b9f4b7595bc..3e7510205af 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -1173,13 +1173,13 @@ cmd_error (data) | |||
| 1173 | cancel_hourglass (); | 1173 | cancel_hourglass (); |
| 1174 | #endif | 1174 | #endif |
| 1175 | 1175 | ||
| 1176 | if (!NILP (executing_macro)) | 1176 | if (!NILP (executing_kbd_macro)) |
| 1177 | { | 1177 | { |
| 1178 | if (executing_macro_iterations == 1) | 1178 | if (executing_kbd_macro_iterations == 1) |
| 1179 | sprintf (macroerror, "After 1 kbd macro iteration: "); | 1179 | sprintf (macroerror, "After 1 kbd macro iteration: "); |
| 1180 | else | 1180 | else |
| 1181 | sprintf (macroerror, "After %d kbd macro iterations: ", | 1181 | sprintf (macroerror, "After %d kbd macro iterations: ", |
| 1182 | executing_macro_iterations); | 1182 | executing_kbd_macro_iterations); |
| 1183 | } | 1183 | } |
| 1184 | else | 1184 | else |
| 1185 | *macroerror = 0; | 1185 | *macroerror = 0; |
| @@ -1187,7 +1187,7 @@ cmd_error (data) | |||
| 1187 | Vstandard_output = Qt; | 1187 | Vstandard_output = Qt; |
| 1188 | Vstandard_input = Qt; | 1188 | Vstandard_input = Qt; |
| 1189 | Vexecuting_kbd_macro = Qnil; | 1189 | Vexecuting_kbd_macro = Qnil; |
| 1190 | executing_macro = Qnil; | 1190 | executing_kbd_macro = Qnil; |
| 1191 | current_kboard->Vprefix_arg = Qnil; | 1191 | current_kboard->Vprefix_arg = Qnil; |
| 1192 | current_kboard->Vlast_prefix_arg = Qnil; | 1192 | current_kboard->Vlast_prefix_arg = Qnil; |
| 1193 | cancel_echoing (); | 1193 | cancel_echoing (); |
| @@ -1288,7 +1288,7 @@ command_loop () | |||
| 1288 | { | 1288 | { |
| 1289 | Lisp_Object val; | 1289 | Lisp_Object val; |
| 1290 | val = internal_catch (Qexit, command_loop_2, Qnil); | 1290 | val = internal_catch (Qexit, command_loop_2, Qnil); |
| 1291 | executing_macro = Qnil; | 1291 | executing_kbd_macro = Qnil; |
| 1292 | return val; | 1292 | return val; |
| 1293 | } | 1293 | } |
| 1294 | else | 1294 | else |
| @@ -1300,7 +1300,7 @@ command_loop () | |||
| 1300 | other reason. */ | 1300 | other reason. */ |
| 1301 | any_kboard_state (); | 1301 | any_kboard_state (); |
| 1302 | internal_catch (Qtop_level, command_loop_2, Qnil); | 1302 | internal_catch (Qtop_level, command_loop_2, Qnil); |
| 1303 | executing_macro = Qnil; | 1303 | executing_kbd_macro = Qnil; |
| 1304 | 1304 | ||
| 1305 | /* End of file in -batch run causes exit here. */ | 1305 | /* End of file in -batch run causes exit here. */ |
| 1306 | if (noninteractive) | 1306 | if (noninteractive) |
| @@ -2517,18 +2517,18 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2517 | Also, some things replace the macro with t | 2517 | Also, some things replace the macro with t |
| 2518 | to force an early exit. */ | 2518 | to force an early exit. */ |
| 2519 | if (EQ (Vexecuting_kbd_macro, Qt) | 2519 | if (EQ (Vexecuting_kbd_macro, Qt) |
| 2520 | || executing_macro_index >= XFASTINT (Flength (Vexecuting_kbd_macro))) | 2520 | || executing_kbd_macro_index >= XFASTINT (Flength (Vexecuting_kbd_macro))) |
| 2521 | { | 2521 | { |
| 2522 | XSETINT (c, -1); | 2522 | XSETINT (c, -1); |
| 2523 | goto exit; | 2523 | goto exit; |
| 2524 | } | 2524 | } |
| 2525 | 2525 | ||
| 2526 | c = Faref (Vexecuting_kbd_macro, make_number (executing_macro_index)); | 2526 | c = Faref (Vexecuting_kbd_macro, make_number (executing_kbd_macro_index)); |
| 2527 | if (STRINGP (Vexecuting_kbd_macro) | 2527 | if (STRINGP (Vexecuting_kbd_macro) |
| 2528 | && (XINT (c) & 0x80) && (XUINT (c) <= 0xff)) | 2528 | && (XINT (c) & 0x80) && (XUINT (c) <= 0xff)) |
| 2529 | XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80)); | 2529 | XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80)); |
| 2530 | 2530 | ||
| 2531 | executing_macro_index++; | 2531 | executing_kbd_macro_index++; |
| 2532 | 2532 | ||
| 2533 | goto from_macro; | 2533 | goto from_macro; |
| 2534 | } | 2534 | } |
diff --git a/src/macros.c b/src/macros.c index 04c8e1cd61f..8b17c9fb261 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -35,21 +35,21 @@ Lisp_Object Vexecuting_kbd_macro; | |||
| 35 | 35 | ||
| 36 | /* Index of next character to fetch from that macro. */ | 36 | /* Index of next character to fetch from that macro. */ |
| 37 | 37 | ||
| 38 | EMACS_INT executing_macro_index; | 38 | EMACS_INT executing_kbd_macro_index; |
| 39 | 39 | ||
| 40 | /* Number of successful iterations so far | 40 | /* Number of successful iterations so far |
| 41 | for innermost keyboard macro. | 41 | for innermost keyboard macro. |
| 42 | This is not bound at each level, | 42 | This is not bound at each level, |
| 43 | so after an error, it describes the innermost interrupted macro. */ | 43 | so after an error, it describes the innermost interrupted macro. */ |
| 44 | 44 | ||
| 45 | int executing_macro_iterations; | 45 | int executing_kbd_macro_iterations; |
| 46 | 46 | ||
| 47 | /* This is the macro that was executing. | 47 | /* This is the macro that was executing. |
| 48 | This is not bound at each level, | 48 | This is not bound at each level, |
| 49 | so after an error, it describes the innermost interrupted macro. | 49 | so after an error, it describes the innermost interrupted macro. |
| 50 | We use it only as a kind of flag, so no need to protect it. */ | 50 | We use it only as a kind of flag, so no need to protect it. */ |
| 51 | 51 | ||
| 52 | Lisp_Object executing_macro; | 52 | Lisp_Object executing_kbd_macro; |
| 53 | 53 | ||
| 54 | extern Lisp_Object real_this_command; | 54 | extern Lisp_Object real_this_command; |
| 55 | 55 | ||
| @@ -114,7 +114,7 @@ macro before appending to it. */) | |||
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | /* Must convert meta modifier when copying string to vector. */ | 116 | /* Must convert meta modifier when copying string to vector. */ |
| 117 | cvt = STRINGP (current_kboard->Vlast_kbd_macro); | 117 | cvt = STRINGP (current_kboard->Vlast_kbd_macro); |
| 118 | for (i = 0; i < len; i++) | 118 | for (i = 0; i < len; i++) |
| 119 | { | 119 | { |
| 120 | Lisp_Object c; | 120 | Lisp_Object c; |
| @@ -285,8 +285,8 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 285 | return Qnil; | 285 | return Qnil; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | /* Restore Vexecuting_kbd_macro and executing_macro_index - called when | 288 | /* Restore Vexecuting_kbd_macro and executing_kbd_macro_index. |
| 289 | the unwind-protect in Fexecute_kbd_macro gets invoked. */ | 289 | Called when the unwind-protect in Fexecute_kbd_macro gets invoked. */ |
| 290 | 290 | ||
| 291 | static Lisp_Object | 291 | static Lisp_Object |
| 292 | pop_kbd_macro (info) | 292 | pop_kbd_macro (info) |
| @@ -295,7 +295,7 @@ pop_kbd_macro (info) | |||
| 295 | Lisp_Object tem; | 295 | Lisp_Object tem; |
| 296 | Vexecuting_kbd_macro = XCAR (info); | 296 | Vexecuting_kbd_macro = XCAR (info); |
| 297 | tem = XCDR (info); | 297 | tem = XCDR (info); |
| 298 | executing_macro_index = XINT (XCAR (tem)); | 298 | executing_kbd_macro_index = XINT (XCAR (tem)); |
| 299 | real_this_command = XCDR (tem); | 299 | real_this_command = XCDR (tem); |
| 300 | Frun_hooks (1, &Qkbd_macro_termination_hook); | 300 | Frun_hooks (1, &Qkbd_macro_termination_hook); |
| 301 | return Qnil; | 301 | return Qnil; |
| @@ -318,7 +318,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 318 | struct gcpro gcpro1, gcpro2; | 318 | struct gcpro gcpro1, gcpro2; |
| 319 | int success_count = 0; | 319 | int success_count = 0; |
| 320 | 320 | ||
| 321 | executing_macro_iterations = 0; | 321 | executing_kbd_macro_iterations = 0; |
| 322 | 322 | ||
| 323 | if (!NILP (count)) | 323 | if (!NILP (count)) |
| 324 | { | 324 | { |
| @@ -331,7 +331,7 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 331 | error ("Keyboard macros must be strings or vectors"); | 331 | error ("Keyboard macros must be strings or vectors"); |
| 332 | 332 | ||
| 333 | tem = Fcons (Vexecuting_kbd_macro, | 333 | tem = Fcons (Vexecuting_kbd_macro, |
| 334 | Fcons (make_number (executing_macro_index), | 334 | Fcons (make_number (executing_kbd_macro_index), |
| 335 | real_this_command)); | 335 | real_this_command)); |
| 336 | record_unwind_protect (pop_kbd_macro, tem); | 336 | record_unwind_protect (pop_kbd_macro, tem); |
| 337 | 337 | ||
| @@ -339,8 +339,8 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 339 | do | 339 | do |
| 340 | { | 340 | { |
| 341 | Vexecuting_kbd_macro = final; | 341 | Vexecuting_kbd_macro = final; |
| 342 | executing_macro = final; | 342 | executing_kbd_macro = final; |
| 343 | executing_macro_index = 0; | 343 | executing_kbd_macro_index = 0; |
| 344 | 344 | ||
| 345 | current_kboard->Vprefix_arg = Qnil; | 345 | current_kboard->Vprefix_arg = Qnil; |
| 346 | 346 | ||
| @@ -354,14 +354,14 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */) | |||
| 354 | 354 | ||
| 355 | command_loop_1 (); | 355 | command_loop_1 (); |
| 356 | 356 | ||
| 357 | executing_macro_iterations = ++success_count; | 357 | executing_kbd_macro_iterations = ++success_count; |
| 358 | 358 | ||
| 359 | QUIT; | 359 | QUIT; |
| 360 | } | 360 | } |
| 361 | while (--repeat | 361 | while (--repeat |
| 362 | && (STRINGP (Vexecuting_kbd_macro) || VECTORP (Vexecuting_kbd_macro))); | 362 | && (STRINGP (Vexecuting_kbd_macro) || VECTORP (Vexecuting_kbd_macro))); |
| 363 | 363 | ||
| 364 | executing_macro = Qnil; | 364 | executing_kbd_macro = Qnil; |
| 365 | 365 | ||
| 366 | real_this_command = Vexecuting_kbd_macro; | 366 | real_this_command = Vexecuting_kbd_macro; |
| 367 | 367 | ||
| @@ -373,7 +373,7 @@ void | |||
| 373 | init_macros () | 373 | init_macros () |
| 374 | { | 374 | { |
| 375 | Vexecuting_kbd_macro = Qnil; | 375 | Vexecuting_kbd_macro = Qnil; |
| 376 | executing_macro = Qnil; | 376 | executing_kbd_macro = Qnil; |
| 377 | } | 377 | } |
| 378 | 378 | ||
| 379 | void | 379 | void |
| @@ -400,7 +400,7 @@ an existing macro. */); | |||
| 400 | doc: /* Currently executing keyboard macro (string or vector). | 400 | doc: /* Currently executing keyboard macro (string or vector). |
| 401 | This is nil when not executing a keyboard macro. */); | 401 | This is nil when not executing a keyboard macro. */); |
| 402 | 402 | ||
| 403 | DEFVAR_INT ("executing-macro-index", &executing_macro_index, | 403 | DEFVAR_INT ("executing-kbd-macro-index", &executing_kbd_macro_index, |
| 404 | doc: /* Index in currently executing keyboard macro; undefined if none executing. */); | 404 | doc: /* Index in currently executing keyboard macro; undefined if none executing. */); |
| 405 | 405 | ||
| 406 | DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro, | 406 | DEFVAR_KBOARD ("last-kbd-macro", Vlast_kbd_macro, |
diff --git a/src/macros.h b/src/macros.h index f406d62559f..bf33ea8325b 100644 --- a/src/macros.h +++ b/src/macros.h | |||
| @@ -25,20 +25,20 @@ extern Lisp_Object Vexecuting_kbd_macro; | |||
| 25 | 25 | ||
| 26 | /* Index of next character to fetch from that macro. */ | 26 | /* Index of next character to fetch from that macro. */ |
| 27 | 27 | ||
| 28 | extern EMACS_INT executing_macro_index; | 28 | extern EMACS_INT executing_kbd_macro_index; |
| 29 | 29 | ||
| 30 | /* Number of successful iterations so far | 30 | /* Number of successful iterations so far |
| 31 | for innermost keyboard macro. | 31 | for innermost keyboard macro. |
| 32 | This is not bound at each level, | 32 | This is not bound at each level, |
| 33 | so after an error, it describes the innermost interrupted macro. */ | 33 | so after an error, it describes the innermost interrupted macro. */ |
| 34 | 34 | ||
| 35 | extern int executing_macro_iterations; | 35 | extern int executing_kbd_macro_iterations; |
| 36 | 36 | ||
| 37 | /* This is the macro that was executing. | 37 | /* This is the macro that was executing. |
| 38 | This is not bound at each level, | 38 | This is not bound at each level, |
| 39 | so after an error, it describes the innermost interrupted macro. */ | 39 | so after an error, it describes the innermost interrupted macro. */ |
| 40 | 40 | ||
| 41 | extern Lisp_Object executing_macro; | 41 | extern Lisp_Object executing_kbd_macro; |
| 42 | 42 | ||
| 43 | /* Finish defining the current keyboard macro. */ | 43 | /* Finish defining the current keyboard macro. */ |
| 44 | 44 | ||