changeset 25600:6cea4c28fc1c

(fix_submap_inheritance): Do nothing if the proper parent is an ancestor of SUBMAP; otherwise, add it as the ultimate ancestor.
author Richard M. Stallman <rms@gnu.org>
date Wed, 08 Sep 1999 05:14:39 +0000
parents 34282f1ae111
children 5a25ec8539c4
files src/keymap.c
diffstat 1 files changed, 17 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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.