aboutsummaryrefslogtreecommitdiffstats
path: root/src/macros.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/macros.c')
-rw-r--r--src/macros.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/macros.c b/src/macros.c
index 60f30c3fbbe..d43e37513f5 100644
--- a/src/macros.c
+++ b/src/macros.c
@@ -1,6 +1,6 @@
1/* Keyboard macros. 1/* Keyboard macros.
2 2
3Copyright (C) 1985-1986, 1993, 2000-2011 Free Software Foundation, Inc. 3Copyright (C) 1985-1986, 1993, 2000-2012 Free Software Foundation, Inc.
4 4
5This file is part of GNU Emacs. 5This file is part of GNU Emacs.
6 6
@@ -35,7 +35,7 @@ static Lisp_Object Qkbd_macro_termination_hook;
35 This is not bound at each level, 35 This is not bound at each level,
36 so after an error, it describes the innermost interrupted macro. */ 36 so after an error, it describes the innermost interrupted macro. */
37 37
38int executing_kbd_macro_iterations; 38EMACS_INT executing_kbd_macro_iterations;
39 39
40/* This is the macro that was executing. 40/* This is the macro that was executing.
41 This is not bound at each level, 41 This is not bound at each level,
@@ -62,9 +62,9 @@ macro before appending to it. */)
62 62
63 if (!current_kboard->kbd_macro_buffer) 63 if (!current_kboard->kbd_macro_buffer)
64 { 64 {
65 current_kboard->kbd_macro_bufsize = 30;
66 current_kboard->kbd_macro_buffer 65 current_kboard->kbd_macro_buffer
67 = (Lisp_Object *)xmalloc (30 * sizeof (Lisp_Object)); 66 = (Lisp_Object *)xmalloc (30 * sizeof (Lisp_Object));
67 current_kboard->kbd_macro_bufsize = 30;
68 } 68 }
69 update_mode_lines++; 69 update_mode_lines++;
70 if (NILP (append)) 70 if (NILP (append))
@@ -175,11 +175,11 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
175 175
176 if (XFASTINT (repeat) == 0) 176 if (XFASTINT (repeat) == 0)
177 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc); 177 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc);
178 else 178 else if (XINT (repeat) > 1)
179 { 179 {
180 XSETINT (repeat, XINT (repeat)-1); 180 XSETINT (repeat, XINT (repeat)-1);
181 if (XINT (repeat) > 0) 181 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro),
182 Fexecute_kbd_macro (KVAR (current_kboard, Vlast_kbd_macro), repeat, loopfunc); 182 repeat, loopfunc);
183 } 183 }
184 return Qnil; 184 return Qnil;
185} 185}
@@ -202,7 +202,7 @@ store_kbd_macro_char (Lisp_Object c)
202 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *kb->kbd_macro_buffer / 2 202 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof *kb->kbd_macro_buffer / 2
203 < kb->kbd_macro_bufsize) 203 < kb->kbd_macro_bufsize)
204 memory_full (SIZE_MAX); 204 memory_full (SIZE_MAX);
205 nbytes = kb->kbd_macro_bufsize * 2 * sizeof *kb->kbd_macro_buffer; 205 nbytes = kb->kbd_macro_bufsize * (2 * sizeof *kb->kbd_macro_buffer);
206 kb->kbd_macro_buffer 206 kb->kbd_macro_buffer
207 = (Lisp_Object *) xrealloc (kb->kbd_macro_buffer, nbytes); 207 = (Lisp_Object *) xrealloc (kb->kbd_macro_buffer, nbytes);
208 kb->kbd_macro_bufsize *= 2; 208 kb->kbd_macro_bufsize *= 2;
@@ -302,9 +302,9 @@ each iteration of the macro. Iteration stops if LOOPFUNC returns nil. */)
302 Lisp_Object final; 302 Lisp_Object final;
303 Lisp_Object tem; 303 Lisp_Object tem;
304 int pdlcount = SPECPDL_INDEX (); 304 int pdlcount = SPECPDL_INDEX ();
305 int repeat = 1; 305 EMACS_INT repeat = 1;
306 struct gcpro gcpro1, gcpro2; 306 struct gcpro gcpro1, gcpro2;
307 int success_count = 0; 307 EMACS_INT success_count = 0;
308 308
309 executing_kbd_macro_iterations = 0; 309 executing_kbd_macro_iterations = 0;
310 310