comparison src/macros.c @ 173:8eaf7971accc r20-3b13

Import from CVS: tag r20-3b13
author cvs
date Mon, 13 Aug 2007 09:49:09 +0200
parents 859a2309aef8
children c5d627a313b1
comparison
equal deleted inserted replaced
172:a38aed19690b 173:8eaf7971accc
116 { 116 {
117 int i; 117 int i;
118 int size = con->kbd_macro_end; 118 int size = con->kbd_macro_end;
119 con->last_kbd_macro = make_vector (size, Qnil); 119 con->last_kbd_macro = make_vector (size, Qnil);
120 for (i = 0; i < con->kbd_macro_end; i++) 120 for (i = 0; i < con->kbd_macro_end; i++)
121 vector_data (XVECTOR (con->last_kbd_macro)) [i] = 121 XVECTOR_DATA (con->last_kbd_macro) [i] =
122 vector_data (XVECTOR (con->kbd_macro_builder)) [i]; 122 XVECTOR_DATA (con->kbd_macro_builder) [i];
123 con->defining_kbd_macro = Qnil; 123 con->defining_kbd_macro = Qnil;
124 MARK_MODELINE_CHANGED; 124 MARK_MODELINE_CHANGED;
125 message ("Keyboard macro defined"); 125 message ("Keyboard macro defined");
126 } 126 }
127 127
142 void 142 void
143 store_kbd_macro_event (Lisp_Object event) 143 store_kbd_macro_event (Lisp_Object event)
144 { 144 {
145 struct console *con = event_console_or_selected (event); 145 struct console *con = event_console_or_selected (event);
146 146
147 if (con->kbd_macro_ptr == XVECTOR (con->kbd_macro_builder)->size) 147 if (con->kbd_macro_ptr == XVECTOR_LENGTH (con->kbd_macro_builder))
148 { 148 {
149 int i; 149 int i;
150 int old_size = XVECTOR (con->kbd_macro_builder)->size; 150 int old_size = XVECTOR_LENGTH (con->kbd_macro_builder);
151 int new_size = old_size * 2; 151 int new_size = old_size * 2;
152 Lisp_Object new = make_vector (new_size, Qnil); 152 Lisp_Object new = make_vector (new_size, Qnil);
153 for (i = 0; i < old_size; i++) 153 for (i = 0; i < old_size; i++)
154 vector_data (XVECTOR (new)) [i] = 154 XVECTOR_DATA (new) [i] = XVECTOR_DATA (con->kbd_macro_builder) [i];
155 vector_data (XVECTOR (con->kbd_macro_builder)) [i];
156 con->kbd_macro_builder = new; 155 con->kbd_macro_builder = new;
157 } 156 }
158 vector_data (XVECTOR (con->kbd_macro_builder)) [con->kbd_macro_ptr++] = 157 XVECTOR_DATA (con->kbd_macro_builder) [con->kbd_macro_ptr++] =
159 Fcopy_event (event, Qnil); 158 Fcopy_event (event, Qnil);
160 } 159 }
161 160
162 /* Extract the next kbd-macro element into the given event. 161 /* Extract the next kbd-macro element into the given event.
163 If we're done, throws to the catch in Fexecute_kbd_macro(). 162 If we're done, throws to the catch in Fexecute_kbd_macro().