From: Karl Heuer Date: Thu, 21 Dec 1995 17:10:27 +0000 (+0000) Subject: (Fkey_binding): Handle text-property keymaps. X-Git-Tag: emacs-19.34~2089 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d964248c519c4da03205b23bd301027c0f35d951;p=emacs.git (Fkey_binding): Handle text-property keymaps. Include puresize.h. (store_in_keymap): Check PURE_P (def) and copy if nec. --- diff --git a/src/keymap.c b/src/keymap.c index 29b8c49af1d..19606fccbf9 100644 --- a/src/keymap.c +++ b/src/keymap.c @@ -27,6 +27,7 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #include "keyboard.h" #include "termhooks.h" #include "blockinput.h" +#include "puresize.h" #define min(a, b) ((a) < (b) ? (a) : (b)) @@ -405,8 +406,7 @@ store_in_keymap (keymap, idx, def) { /* 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 @@ recognize the default bindings, just as `read-key-sequence' does.") } 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 @@ recognize the default bindings, just as `read-key-sequence' does.") 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); }