changeset 29282:59f2b30d577b

Include intervals.h. (Fkey_binding, Fwhere_is_internal): Deal with `keymap' property.
author Dave Love <fx@gnu.org>
date Mon, 29 May 2000 11:54:51 +0000
parents e27af8cf09bd
children 6068e9acd0ff
files src/keymap.c
diffstat 1 files changed, 23 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Mon May 29 11:51:34 2000 +0000
+++ b/src/keymap.c	Mon May 29 11:54:51 2000 +0000
@@ -30,6 +30,7 @@
 #include "termhooks.h"
 #include "blockinput.h"
 #include "puresize.h"
+#include "intervals.h"
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
@@ -1285,7 +1286,15 @@
 	      RETURN_UNGCPRO (value);
 	  }
 
-      local = get_local_map (PT, current_buffer);
+      local = get_local_map (PT, current_buffer, keymap);
+      if (! NILP (local))
+	{
+	  value = Flookup_key (local, key, accept_default);
+	  if (! NILP (value) && !INTEGERP (value))
+	    RETURN_UNGCPRO (value);
+	}
+
+      local = get_local_map (PT, current_buffer, local_map);
 
       if (! NILP (local))
 	{
@@ -2068,14 +2077,25 @@
      shadowed bindings. */
   keymap1 = keymap;
   if (! keymap_specified)
-    keymap1 = get_local_map (PT, current_buffer);
+    keymap1 = get_local_map (PT, current_buffer, keymap);
     
   if (!NILP (keymap1))
     maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil),
 		   Faccessible_keymaps (get_keymap (current_global_map),
 					Qnil));
   else
-    maps = Faccessible_keymaps (get_keymap (current_global_map), Qnil);
+    {
+      keymap1 = keymap;
+      if (! keymap_specified)
+	keymap1 = get_local_map (PT, current_buffer, local_map);
+    
+      if (!NILP (keymap1))
+	maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil),
+		       Faccessible_keymaps (get_keymap (current_global_map),
+					    Qnil));
+      else
+	maps = Faccessible_keymaps (get_keymap (current_global_map), Qnil);
+    }
 
   /* Put the minor mode keymaps on the front.  */
   if (! keymap_specified)