aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 1b673384806..c209a690226 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -426,7 +426,23 @@ fix_submap_inheritance (map, event, submap)
426 parent_entry = Qnil; 426 parent_entry = Qnil;
427 427
428 if (! EQ (parent_entry, submap)) 428 if (! EQ (parent_entry, submap))
429 Fset_keymap_parent (submap, parent_entry); 429 {
430 Lisp_Object submap_parent;
431 submap_parent = submap;
432 while (1)
433 {
434 Lisp_Object tem;
435 tem = Fkeymap_parent (submap_parent);
436 if (EQ (tem, parent_entry))
437 return;
438 if (CONSP (tem)
439 && EQ (XCONS (tem)->car, Qkeymap))
440 submap_parent = tem;
441 else
442 break;
443 }
444 Fset_keymap_parent (submap_parent, parent_entry);
445 }
430} 446}
431 447
432/* Look up IDX in MAP. IDX may be any sort of event. 448/* Look up IDX in MAP. IDX may be any sort of event.