Mercurial > hg > xemacs-beta
comparison src/keymap.c @ 2:ac2d302a0011 r19-15b2
Import from CVS: tag r19-15b2
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:46:35 +0200 |
parents | 376386a54a3c |
children | 4b173ad71786 |
comparison
equal
deleted
inserted
replaced
1:c0c6a60d29db | 2:ac2d302a0011 |
---|---|
482 make_char (string_char (XSYMBOL (keysym)->name, 0)); | 482 make_char (string_char (XSYMBOL (keysym)->name, 0)); |
483 keysym = i_fart_on_gcc; | 483 keysym = i_fart_on_gcc; |
484 } | 484 } |
485 | 485 |
486 if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ | 486 if (modifiers & MOD_META) /* Utterly hateful ESC lossage */ |
487 { | 487 { |
488 Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), | 488 Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (MOD_META), |
489 k->table, Qnil); | 489 k->table, Qnil); |
490 if (NILP (submap)) | 490 if (NILP (submap)) |
491 return (Qnil); | 491 return (Qnil); |
492 k = XKEYMAP (submap); | 492 k = XKEYMAP (submap); |
493 modifiers &= ~MOD_META; | 493 modifiers &= ~MOD_META; |
494 } | 494 } |
495 | 495 |
496 if (modifiers != 0) | 496 if (modifiers != 0) |
497 { | 497 { |
498 Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (modifiers), | 498 Lisp_Object submap = Fgethash (MAKE_MODIFIER_HASH_KEY (modifiers), |
499 k->table, Qnil); | 499 k->table, Qnil); |
500 if (NILP (submap)) | 500 if (NILP (submap)) |
501 return (Qnil); | 501 return (Qnil); |
502 k = XKEYMAP (submap); | 502 k = XKEYMAP (submap); |
503 } | 503 } |
504 return (Fgethash (keysym, k->table, Qnil)); | 504 return (Fgethash (keysym, k->table, Qnil)); |
505 } | 505 } |
506 | 506 |
507 static void | 507 static void |
508 keymap_store_inverse_internal (Lisp_Object inverse_table, | 508 keymap_store_inverse_internal (Lisp_Object inverse_table, |
516 keys = keysym; | 516 keys = keysym; |
517 /* Don't cons this unless necessary */ | 517 /* Don't cons this unless necessary */ |
518 /* keys = Fcons (keysym, Qnil); */ | 518 /* keys = Fcons (keysym, Qnil); */ |
519 Fputhash (value, keys, inverse_table); | 519 Fputhash (value, keys, inverse_table); |
520 } | 520 } |
521 | |
522 else if (!CONSP (keys)) | 521 else if (!CONSP (keys)) |
523 { | 522 { |
524 /* Now it's necessary to cons */ | 523 /* Now it's necessary to cons */ |
525 keys = Fcons (keys, keysym); | 524 keys = Fcons (keys, keysym); |
526 Fputhash (value, keys, inverse_table); | 525 Fputhash (value, keys, inverse_table); |
1968 /************************************************************************/ | 1967 /************************************************************************/ |
1969 /* Looking up keys in keymaps */ | 1968 /* Looking up keys in keymaps */ |
1970 /************************************************************************/ | 1969 /************************************************************************/ |
1971 | 1970 |
1972 /* We need a very fast (i.e., non-consing) version of lookup-key in order | 1971 /* We need a very fast (i.e., non-consing) version of lookup-key in order |
1973 to make where-is-internal really fly. | 1972 to make where-is-internal really fly. */ |
1974 */ | |
1975 | 1973 |
1976 struct raw_lookup_key_mapper_closure | 1974 struct raw_lookup_key_mapper_closure |
1977 { | 1975 { |
1978 int remaining; | 1976 int remaining; |
1979 CONST struct key_data *raw_keys; | 1977 CONST struct key_data *raw_keys; |
1980 int raw_keys_count; | 1978 int raw_keys_count; |
1981 int keys_so_far; | 1979 int keys_so_far; |
1982 int accept_default; | 1980 int accept_default; |
1983 }; | 1981 }; |
1984 | 1982 |
1985 static Lisp_Object raw_lookup_key_mapper (Lisp_Object k, void *); | 1983 static Lisp_Object raw_lookup_key_mapper (Lisp_Object k, void *); |
1986 | 1984 |
1987 /* Caller should gc-protect args (keymaps may autoload) */ | 1985 /* Caller should gc-protect args (keymaps may autoload) */ |
1988 static Lisp_Object | 1986 static Lisp_Object |
2189 else if (!STRINGP (keys)) | 2187 else if (!STRINGP (keys)) |
2190 { | 2188 { |
2191 keys = wrong_type_argument (Qsequencep, keys); | 2189 keys = wrong_type_argument (Qsequencep, keys); |
2192 return Flookup_key (keymap, keys, accept_default); | 2190 return Flookup_key (keymap, keys, accept_default); |
2193 } | 2191 } |
2194 else | 2192 else /* STRINGP (keys) */ |
2195 { | 2193 { |
2196 int length = string_char_length (XSTRING (keys)); | 2194 int length = string_char_length (XSTRING (keys)); |
2197 int i; | 2195 int i; |
2198 struct key_data *raw_keys | 2196 struct key_data *raw_keys |
2199 = (struct key_data *) alloca (sizeof (struct key_data) * length); | 2197 = (struct key_data *) alloca (sizeof (struct key_data) * length); |