changeset 13771:28790743a5a3

(Fkey_binding): Handle text-property keymaps. Include puresize.h. (store_in_keymap): Check PURE_P (def) and copy if nec.
author Karl Heuer <kwzh@gnu.org>
date Thu, 21 Dec 1995 17:10:27 +0000
parents 197ada595605
children c387f71fe4b6
files src/keymap.c
diffstat 1 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/keymap.c	Thu Dec 21 17:08:30 1995 +0000
+++ b/src/keymap.c	Thu Dec 21 17:10:27 1995 +0000
@@ -27,6 +27,7 @@
 #include "keyboard.h"
 #include "termhooks.h"
 #include "blockinput.h"
+#include "puresize.h"
 
 #define min(a, b) ((a) < (b) ? (a) : (b))
 
@@ -405,8 +406,7 @@
 {
   /* If we are preparing to dump, and DEF is a menu element
      with a menu item string, copy it to ensure it is not pure.  */
-  if (!NILP (Vpurify_flag) && CONSP (def)
-      && STRINGP (XCONS (def)->car))
+  if (CONSP (def) && PURE_P (def) && STRINGP (XCONS (def)->car))
     def = Fcons (XCONS (def)->car, XCONS (def)->cdr);
 
   if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap))
@@ -931,6 +931,8 @@
     }
   else
     { 
+      Lisp_Object local;
+
       nmaps = current_minor_maps (0, &maps);
       /* Note that all these maps are GCPRO'd
 	 in the places where we found them.  */
@@ -943,9 +945,11 @@
 	      RETURN_UNGCPRO (value);
 	  }
 
-      if (! NILP (current_buffer->keymap))
+      local = get_local_map (PT, current_buffer);
+
+      if (! NILP (local))
 	{
-	  value = Flookup_key (current_buffer->keymap, key, accept_default);
+	  value = Flookup_key (local, key, accept_default);
 	  if (! NILP (value) && !INTEGERP (value))
 	    RETURN_UNGCPRO (value);
 	}