aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-12-21 17:10:27 +0000
committerKarl Heuer1995-12-21 17:10:27 +0000
commitd964248c519c4da03205b23bd301027c0f35d951 (patch)
treedbeff78a7dfbea0da79798f32971443eebf41d09 /src
parent22a513448fdbea14ccfa2cf081b2947a5fd15e0b (diff)
downloademacs-d964248c519c4da03205b23bd301027c0f35d951.tar.gz
emacs-d964248c519c4da03205b23bd301027c0f35d951.zip
(Fkey_binding): Handle text-property keymaps.
Include puresize.h. (store_in_keymap): Check PURE_P (def) and copy if nec.
Diffstat (limited to 'src')
-rw-r--r--src/keymap.c12
1 files changed, 8 insertions, 4 deletions
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. */
27#include "keyboard.h" 27#include "keyboard.h"
28#include "termhooks.h" 28#include "termhooks.h"
29#include "blockinput.h" 29#include "blockinput.h"
30#include "puresize.h"
30 31
31#define min(a, b) ((a) < (b) ? (a) : (b)) 32#define min(a, b) ((a) < (b) ? (a) : (b))
32 33
@@ -405,8 +406,7 @@ store_in_keymap (keymap, idx, def)
405{ 406{
406 /* If we are preparing to dump, and DEF is a menu element 407 /* If we are preparing to dump, and DEF is a menu element
407 with a menu item string, copy it to ensure it is not pure. */ 408 with a menu item string, copy it to ensure it is not pure. */
408 if (!NILP (Vpurify_flag) && CONSP (def) 409 if (CONSP (def) && PURE_P (def) && STRINGP (XCONS (def)->car))
409 && STRINGP (XCONS (def)->car))
410 def = Fcons (XCONS (def)->car, XCONS (def)->cdr); 410 def = Fcons (XCONS (def)->car, XCONS (def)->cdr);
411 411
412 if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap)) 412 if (!CONSP (keymap) || ! EQ (XCONS (keymap)->car, Qkeymap))
@@ -931,6 +931,8 @@ recognize the default bindings, just as `read-key-sequence' does.")
931 } 931 }
932 else 932 else
933 { 933 {
934 Lisp_Object local;
935
934 nmaps = current_minor_maps (0, &maps); 936 nmaps = current_minor_maps (0, &maps);
935 /* Note that all these maps are GCPRO'd 937 /* Note that all these maps are GCPRO'd
936 in the places where we found them. */ 938 in the places where we found them. */
@@ -943,9 +945,11 @@ recognize the default bindings, just as `read-key-sequence' does.")
943 RETURN_UNGCPRO (value); 945 RETURN_UNGCPRO (value);
944 } 946 }
945 947
946 if (! NILP (current_buffer->keymap)) 948 local = get_local_map (PT, current_buffer);
949
950 if (! NILP (local))
947 { 951 {
948 value = Flookup_key (current_buffer->keymap, key, accept_default); 952 value = Flookup_key (local, key, accept_default);
949 if (! NILP (value) && !INTEGERP (value)) 953 if (! NILP (value) && !INTEGERP (value))
950 RETURN_UNGCPRO (value); 954 RETURN_UNGCPRO (value);
951 } 955 }