aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier2000-10-22 04:48:48 +0000
committerStefan Monnier2000-10-22 04:48:48 +0000
commit9d0ffdd99fd003e7ac3d3029840bb72293c04440 (patch)
tree742b32c63290642a2ef1c98172a18526a183a9bb /src/keymap.c
parent3511cde8e777b31ece6e2cd689c7553e9ae57edb (diff)
downloademacs-9d0ffdd99fd003e7ac3d3029840bb72293c04440.tar.gz
emacs-9d0ffdd99fd003e7ac3d3029840bb72293c04440.zip
(fix_submap_inheritance): Don't do anything if parent_entry
is nil: since we go to the end of submap anyway, we'd end up setting nil to nil. (access_keymap): Don't use KEYMAPP on meta_map since KEYMAPP doesn't obey autoload.
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 72d40d09872..e351d302131 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -419,9 +419,9 @@ fix_submap_inheritance (map, event, submap)
419 parent_entry = Qnil; 419 parent_entry = Qnil;
420 420
421 /* If MAP's parent has something other than a keymap, 421 /* If MAP's parent has something other than a keymap,
422 our own submap shadows it completely, so use nil as SUBMAP's parent. */ 422 our own submap shadows it completely. */
423 if (! KEYMAPP (parent_entry)) 423 if (! KEYMAPP (parent_entry))
424 parent_entry = Qnil; 424 return;
425 425
426 if (! EQ (parent_entry, submap)) 426 if (! EQ (parent_entry, submap))
427 { 427 {
@@ -430,12 +430,16 @@ fix_submap_inheritance (map, event, submap)
430 while (1) 430 while (1)
431 { 431 {
432 Lisp_Object tem; 432 Lisp_Object tem;
433
433 tem = Fkeymap_parent (submap_parent); 434 tem = Fkeymap_parent (submap_parent);
434 if (keymap_memberp (tem, parent_entry)) 435
435 /* Fset_keymap_parent could create a cycle. */ 436 if (KEYMAPP (tem))
436 return; 437 {
437 if (KEYMAPP (tem)) 438 if (keymap_memberp (tem, parent_entry))
438 submap_parent = tem; 439 /* Fset_keymap_parent could create a cycle. */
440 return;
441 submap_parent = tem;
442 }
439 else 443 else
440 break; 444 break;
441 } 445 }
@@ -483,15 +487,15 @@ access_keymap (map, idx, t_ok, noinherit, autoload)
483 /* Handle the special meta -> esc mapping. */ 487 /* Handle the special meta -> esc mapping. */
484 if (INTEGERP (idx) && XUINT (idx) & meta_modifier) 488 if (INTEGERP (idx) && XUINT (idx) & meta_modifier)
485 { 489 {
486 Lisp_Object meta_map;
487
488 /* See if there is a meta-map. If there's none, there is 490 /* See if there is a meta-map. If there's none, there is
489 no binding for IDX, unless a default binding exists in MAP. */ 491 no binding for IDX, unless a default binding exists in MAP. */
490 meta_map = access_keymap (map, meta_prefix_char, t_ok, noinherit, 492 Lisp_Object meta_map =
491 autoload); 493 get_keymap_1 (access_keymap
492 if (KEYMAPP (meta_map)) 494 (map, meta_prefix_char, t_ok, noinherit, autoload),
495 0, autoload);
496 if (!NILP (meta_map))
493 { 497 {
494 map = get_keymap_1 (meta_map, 0, autoload); 498 map = meta_map;
495 idx = make_number (XUINT (idx) & ~meta_modifier); 499 idx = make_number (XUINT (idx) & ~meta_modifier);
496 } 500 }
497 else if (t_ok) 501 else if (t_ok)