comparison src/keymap.c @ 424:11054d720c21 r21-2-20

Import from CVS: tag r21-2-20
author cvs
date Mon, 13 Aug 2007 11:26:11 +0200
parents 95016f13131a
children
comparison
equal deleted inserted replaced
423:28d9c139be4c 424:11054d720c21
250 /************************************************************************/ 250 /************************************************************************/
251 /* The keymap Lisp object */ 251 /* The keymap Lisp object */
252 /************************************************************************/ 252 /************************************************************************/
253 253
254 static Lisp_Object 254 static Lisp_Object
255 mark_keymap (Lisp_Object obj, void (*markobj) (Lisp_Object)) 255 mark_keymap (Lisp_Object obj)
256 { 256 {
257 Lisp_Keymap *keymap = XKEYMAP (obj); 257 Lisp_Keymap *keymap = XKEYMAP (obj);
258 markobj (keymap->parents); 258 mark_object (keymap->parents);
259 markobj (keymap->prompt); 259 mark_object (keymap->prompt);
260 markobj (keymap->inverse_table); 260 mark_object (keymap->inverse_table);
261 markobj (keymap->sub_maps_cache); 261 mark_object (keymap->sub_maps_cache);
262 markobj (keymap->default_binding); 262 mark_object (keymap->default_binding);
263 markobj (keymap->name); 263 mark_object (keymap->name);
264 return keymap->table; 264 return keymap->table;
265 } 265 }
266 266
267 static void 267 static void
268 print_keymap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag) 268 print_keymap (Lisp_Object obj, Lisp_Object printcharfun, int escapeflag)
276 write_c_string ("#<keymap ", printcharfun); 276 write_c_string ("#<keymap ", printcharfun);
277 if (!NILP (keymap->name)) 277 if (!NILP (keymap->name))
278 print_internal (keymap->name, printcharfun, 1); 278 print_internal (keymap->name, printcharfun, 1);
279 /* #### Yuck! This is no way to form plural! --hniksic */ 279 /* #### Yuck! This is no way to form plural! --hniksic */
280 sprintf (buf, "%s%d entr%s 0x%x>", 280 sprintf (buf, "%s%d entr%s 0x%x>",
281 ((NILP (keymap->name)) ? "" : " "), 281 (NILP (keymap->name) ? "" : " "),
282 size, 282 size,
283 ((size == 1) ? "y" : "ies"), 283 ((size == 1) ? "y" : "ies"),
284 keymap->header.uid); 284 keymap->header.uid);
285 write_c_string (buf, printcharfun); 285 write_c_string (buf, printcharfun);
286 } 286 }
1349 *keysym = QKreturn; 1349 *keysym = QKreturn;
1350 else if (EQ (*keysym, QESC)) 1350 else if (EQ (*keysym, QESC))
1351 *keysym = QKescape; 1351 *keysym = QKescape;
1352 else if (EQ (*keysym, QDEL)) 1352 else if (EQ (*keysym, QDEL))
1353 *keysym = QKdelete; 1353 *keysym = QKdelete;
1354 else if (EQ (*keysym, QSPC))
1355 *keysym = QKspace;
1354 else if (EQ (*keysym, QBS)) 1356 else if (EQ (*keysym, QBS))
1355 *keysym = QKbackspace; 1357 *keysym = QKbackspace;
1356 /* Emacs compatibility */ 1358 /* Emacs compatibility */
1357 else if (EQ(*keysym, Qdown_mouse_1)) 1359 else if (EQ(*keysym, Qdown_mouse_1))
1358 *keysym = Qbutton1; 1360 *keysym = Qbutton1;
3173 int i; 3175 int i;
3174 3176
3175 for (i = 0; i < size; i++) 3177 for (i = 0; i < size; i++)
3176 { 3178 {
3177 Lisp_Object s2 = Fsingle_key_description 3179 Lisp_Object s2 = Fsingle_key_description
3178 (((STRINGP (keys)) 3180 (STRINGP (keys)
3179 ? make_char (string_char (XSTRING (keys), i)) 3181 ? make_char (string_char (XSTRING (keys), i))
3180 : XVECTOR_DATA (keys)[i])); 3182 : XVECTOR_DATA (keys)[i]);
3181 3183
3182 if (i == 0) 3184 if (i == 0)
3183 string = s2; 3185 string = s2;
3184 else 3186 else
3185 { 3187 {
3532 raw_lookup_key() means undefined. */ 3534 raw_lookup_key() means undefined. */
3533 struct key_data *so_far = c->keys_so_far; 3535 struct key_data *so_far = c->keys_so_far;
3534 3536
3535 for (;;) /* loop over all keys that match */ 3537 for (;;) /* loop over all keys that match */
3536 { 3538 {
3537 Lisp_Object k = ((CONSP (keys)) ? XCAR (keys) : keys); 3539 Lisp_Object k = CONSP (keys) ? XCAR (keys) : keys;
3538 int i; 3540 int i;
3539 3541
3540 so_far [keys_count].keysym = k; 3542 so_far [keys_count].keysym = k;
3541 so_far [keys_count].modifiers = modifiers_so_far; 3543 so_far [keys_count].modifiers = modifiers_so_far;
3542 3544
4272 defsymbol (&QLFD, "LFD"); 4274 defsymbol (&QLFD, "LFD");
4273 defsymbol (&QTAB, "TAB"); 4275 defsymbol (&QTAB, "TAB");
4274 defsymbol (&QRET, "RET"); 4276 defsymbol (&QRET, "RET");
4275 defsymbol (&QESC, "ESC"); 4277 defsymbol (&QESC, "ESC");
4276 defsymbol (&QDEL, "DEL"); 4278 defsymbol (&QDEL, "DEL");
4279 defsymbol (&QSPC, "SPC");
4277 defsymbol (&QBS, "BS"); 4280 defsymbol (&QBS, "BS");
4278 } 4281 }
4279 4282
4280 void 4283 void
4281 vars_of_keymap (void) 4284 vars_of_keymap (void)
4325 */ ); 4328 */ );
4326 keymap_tick = 0; 4329 keymap_tick = 0;
4327 4330
4328 staticpro (&Vcurrent_global_map); 4331 staticpro (&Vcurrent_global_map);
4329 4332
4330 Vsingle_space_string = make_string_nocopy ((CONST Bufbyte *) " ", 1); 4333 Vsingle_space_string = make_string ((CONST Bufbyte *) " ", 1);
4331 staticpro (&Vsingle_space_string); 4334 staticpro (&Vsingle_space_string);
4332 } 4335 }
4333 4336
4334 void 4337 void
4335 complex_vars_of_keymap (void) 4338 complex_vars_of_keymap (void)