diff options
| author | Karl Heuer | 1999-03-30 18:02:13 +0000 |
|---|---|---|
| committer | Karl Heuer | 1999-03-30 18:02:13 +0000 |
| commit | 80184dac072806f282c0bae51bd0b2569083cdda (patch) | |
| tree | 84dd71cdbcba4720a945705bdc8310ba37485344 /src | |
| parent | 5f625d0c092478148b779751bf42db35482e0800 (diff) | |
| download | emacs-80184dac072806f282c0bae51bd0b2569083cdda.tar.gz emacs-80184dac072806f282c0bae51bd0b2569083cdda.zip | |
(Fexecute_kbd_macro): Save real_this_command.
(pop_kbd_macro): Restore the saved real_this_command.
(Fcall_last_kbd_macro): Set real_this_command to the macro.
Diffstat (limited to 'src')
| -rw-r--r-- | src/macros.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/macros.c b/src/macros.c index 0d86d9cf54f..a0212e1044a 100644 --- a/src/macros.c +++ b/src/macros.c | |||
| @@ -211,6 +211,8 @@ defining others, use \\[name-last-kbd-macro].") | |||
| 211 | /* Don't interfere with recognition of the previous command | 211 | /* Don't interfere with recognition of the previous command |
| 212 | from before this macro started. */ | 212 | from before this macro started. */ |
| 213 | Vthis_command = current_kboard->Vlast_command; | 213 | Vthis_command = current_kboard->Vlast_command; |
| 214 | /* C-x z after the macro should repeat the macro. */ | ||
| 215 | real_this_command = current_kboard->Vlast_kbd_macro; | ||
| 214 | 216 | ||
| 215 | if (! NILP (current_kboard->defining_kbd_macro)) | 217 | if (! NILP (current_kboard->defining_kbd_macro)) |
| 216 | error ("Can't execute anonymous macro while defining one"); | 218 | error ("Can't execute anonymous macro while defining one"); |
| @@ -235,9 +237,10 @@ pop_kbd_macro (info) | |||
| 235 | Lisp_Object info; | 237 | Lisp_Object info; |
| 236 | { | 238 | { |
| 237 | Lisp_Object tem; | 239 | Lisp_Object tem; |
| 238 | Vexecuting_macro = Fcar (info); | 240 | Vexecuting_macro = XCAR (info); |
| 239 | tem = Fcdr (info); | 241 | tem = XCDR (info); |
| 240 | executing_macro_index = XINT (tem); | 242 | executing_macro_index = XINT (XCAR (tem)); |
| 243 | real_this_command = XCDR (tem); | ||
| 241 | return Qnil; | 244 | return Qnil; |
| 242 | } | 245 | } |
| 243 | 246 | ||
| @@ -267,8 +270,9 @@ COUNT is a repeat count, or nil for once, or 0 for infinite loop.") | |||
| 267 | if (!STRINGP (final) && !VECTORP (final)) | 270 | if (!STRINGP (final) && !VECTORP (final)) |
| 268 | error ("Keyboard macros must be strings or vectors"); | 271 | error ("Keyboard macros must be strings or vectors"); |
| 269 | 272 | ||
| 270 | XSETFASTINT (tem, executing_macro_index); | 273 | tem = Fcons (Vexecuting_macro, |
| 271 | tem = Fcons (Vexecuting_macro, tem); | 274 | Fcons (make_number (executing_macro_index), |
| 275 | real_this_command)); | ||
| 272 | record_unwind_protect (pop_kbd_macro, tem); | 276 | record_unwind_protect (pop_kbd_macro, tem); |
| 273 | 277 | ||
| 274 | GCPRO1 (final); | 278 | GCPRO1 (final); |