Mercurial > hg > xemacs-beta
comparison src/console-tty.c @ 2850:ad0054aa11f1
[xemacs-hg @ 2005-07-08 08:27:32 by aidan]
Fix crash with C-h k C-g on MS Windows
author | aidan |
---|---|
date | Fri, 08 Jul 2005 08:27:34 +0000 |
parents | a25c824ed558 |
children | 141c2920ea48 |
comparison
equal
deleted
inserted
replaced
2849:bfb048b5938f | 2850:ad0054aa11f1 |
---|---|
48 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); | 48 DECLARE_IMAGE_INSTANTIATOR_FORMAT (inherit); |
49 | 49 |
50 Lisp_Object Qterminal_type; | 50 Lisp_Object Qterminal_type; |
51 Lisp_Object Qcontrolling_process; | 51 Lisp_Object Qcontrolling_process; |
52 | 52 |
53 static Lisp_Object Qseen_characters; | 53 Lisp_Object Vtty_seen_characters; |
54 | 54 |
55 static const struct memory_description tty_console_data_description_1 [] = { | 55 static const struct memory_description tty_console_data_description_1 [] = { |
56 { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) }, | 56 { XD_LISP_OBJECT, offsetof (struct tty_console, terminal_type) }, |
57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, | 57 { XD_LISP_OBJECT, offsetof (struct tty_console, instream) }, |
58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, | 58 { XD_LISP_OBJECT, offsetof (struct tty_console, outstream) }, |
360 return Qnil; | 360 return Qnil; |
361 } | 361 } |
362 | 362 |
363 CHECK_CHAR(key); | 363 CHECK_CHAR(key); |
364 | 364 |
365 if (!(HASH_TABLEP(Qseen_characters))) | 365 if (!(HASH_TABLEP(Vtty_seen_characters))) |
366 { | 366 { |
367 /* All the keysyms we deal with are character objects; therefore, we | 367 /* All the keysyms we deal with are character objects; therefore, we |
368 can use eq as the test without worrying. */ | 368 can use eq as the test without worrying. */ |
369 Qseen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, | 369 Vtty_seen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, |
370 HASH_TABLE_EQ); | 370 HASH_TABLE_EQ); |
371 } | 371 } |
372 | 372 |
373 /* Might give the user an opaque error if make_lisp_hash_table fails, | 373 /* Might give the user an opaque error if make_lisp_hash_table fails, |
374 but it won't crash. */ | 374 but it won't crash. */ |
375 CHECK_HASH_TABLE(Qseen_characters); | 375 CHECK_HASH_TABLE(Vtty_seen_characters); |
376 | 376 |
377 val = XCHAR(key); | 377 val = XCHAR(key); |
378 | 378 |
379 /* Same logic as in x_has_keysym; I'm not convinced it's always sane. */ | 379 /* Same logic as in x_has_keysym; I'm not convinced it's always sane. */ |
380 if (val < 0x80) | 380 if (val < 0x80) |
381 { | 381 { |
382 return Qnil; | 382 return Qnil; |
383 } | 383 } |
384 | 384 |
385 if (!NILP(Fgethash(key, Qseen_characters, Qnil))) | 385 if (!NILP(Fgethash(key, Vtty_seen_characters, Qnil))) |
386 { | 386 { |
387 return Qnil; | 387 return Qnil; |
388 } | 388 } |
389 | 389 |
390 if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil))) | 390 if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil))) |
391 { | 391 { |
392 Fputhash(key, Qt, Qseen_characters); | 392 Fputhash(key, Qt, Vtty_seen_characters); |
393 Fdefine_key (Vcurrent_global_map, key, Qself_insert_command); | 393 Fdefine_key (Vcurrent_global_map, key, Qself_insert_command); |
394 return Qt; | 394 return Qt; |
395 } | 395 } |
396 | 396 |
397 return Qnil; | 397 return Qnil; |
449 } | 449 } |
450 | 450 |
451 void | 451 void |
452 vars_of_console_tty (void) | 452 vars_of_console_tty (void) |
453 { | 453 { |
454 Qseen_characters = Qnil; | 454 DEFVAR_LISP ("tty-seen-characters", &Vtty_seen_characters /* |
455 Hash table of non-ASCII characters the TTY subsystem has seen. | |
456 */ ); | |
457 Vtty_seen_characters = Qnil; | |
455 Fprovide (Qtty); | 458 Fprovide (Qtty); |
456 } | 459 } |