comparison src/macros.c @ 49745:282c490f6cd4

(Fstart_kbd_macro): If appending, and last keyboard macro is a string, convert meta modifiers in string when copying the string into a vector.
author Kim F. Storm <storm@cua.dk>
date Wed, 12 Feb 2003 11:08:24 +0000
parents 23a1cea22d13
children eabc4e7986e9 d7ddb3e565de
comparison
equal deleted inserted replaced
49744:d15ccf22e8e8 49745:282c490f6cd4
91 message ("Defining kbd macro..."); 91 message ("Defining kbd macro...");
92 } 92 }
93 else 93 else
94 { 94 {
95 int i, len; 95 int i, len;
96 int cvt;
96 97
97 /* Check the type of last-kbd-macro in case Lisp code changed it. */ 98 /* Check the type of last-kbd-macro in case Lisp code changed it. */
98 if (!STRINGP (current_kboard->Vlast_kbd_macro) 99 if (!STRINGP (current_kboard->Vlast_kbd_macro)
99 && !VECTORP (current_kboard->Vlast_kbd_macro)) 100 && !VECTORP (current_kboard->Vlast_kbd_macro))
100 current_kboard->Vlast_kbd_macro 101 current_kboard->Vlast_kbd_macro
109 current_kboard->kbd_macro_bufsize = len + 30; 110 current_kboard->kbd_macro_bufsize = len + 30;
110 current_kboard->kbd_macro_buffer 111 current_kboard->kbd_macro_buffer
111 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer, 112 = (Lisp_Object *)xrealloc (current_kboard->kbd_macro_buffer,
112 (len + 30) * sizeof (Lisp_Object)); 113 (len + 30) * sizeof (Lisp_Object));
113 } 114 }
115
116 /* Must convert meta modifier when copying string to vector. */
117 cvt = STRINGP (current_kboard->Vlast_kbd_macro);
114 for (i = 0; i < len; i++) 118 for (i = 0; i < len; i++)
115 current_kboard->kbd_macro_buffer[i] 119 {
116 = Faref (current_kboard->Vlast_kbd_macro, make_number (i)); 120 Lisp_Object c;
121 c = Faref (current_kboard->Vlast_kbd_macro, make_number (i));
122 if (cvt && INTEGERP (c) && (XINT (c) & 0x80))
123 c = XSETFASTINT (c, CHAR_META | (XINT (c) & ~0x80));
124 current_kboard->kbd_macro_buffer[i] = c;
125 }
117 126
118 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer + len; 127 current_kboard->kbd_macro_ptr = current_kboard->kbd_macro_buffer + len;
119 current_kboard->kbd_macro_end = current_kboard->kbd_macro_ptr; 128 current_kboard->kbd_macro_end = current_kboard->kbd_macro_ptr;
120 129
121 /* Re-execute the macro we are appending to, 130 /* Re-execute the macro we are appending to,