# HG changeset patch # User Richard M. Stallman # Date 936767679 0 # Node ID 6cea4c28fc1cdaa1a0eddd128a106379f1a5204b # Parent 34282f1ae111def05e4fc19fd0150a444aac3017 (fix_submap_inheritance): Do nothing if the proper parent is an ancestor of SUBMAP; otherwise, add it as the ultimate ancestor. diff -r 34282f1ae111 -r 6cea4c28fc1c src/keymap.c --- a/src/keymap.c Wed Sep 08 01:22:00 1999 +0000 +++ b/src/keymap.c Wed Sep 08 05:14:39 1999 +0000 @@ -426,7 +426,23 @@ parent_entry = Qnil; if (! EQ (parent_entry, submap)) - Fset_keymap_parent (submap, parent_entry); + { + Lisp_Object submap_parent; + submap_parent = submap; + while (1) + { + Lisp_Object tem; + tem = Fkeymap_parent (submap_parent); + if (EQ (tem, parent_entry)) + return; + if (CONSP (tem) + && EQ (XCONS (tem)->car, Qkeymap)) + submap_parent = tem; + else + break; + } + Fset_keymap_parent (submap_parent, parent_entry); + } } /* Look up IDX in MAP. IDX may be any sort of event.