aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorKenichi Handa2012-08-16 21:25:17 +0900
committerKenichi Handa2012-08-16 21:25:17 +0900
commitd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch)
tree8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /src/keymap.c
parent69c41c4070c86baac11a627e9c3d366420aeb7cc (diff)
parent250c8ab9b8f6322959fa3122db83944c30c3894b (diff)
downloademacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz
emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip
merge trunk
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c48
1 files changed, 23 insertions, 25 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 510c5ea7f3e..c550b37c1d6 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -225,7 +225,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
225 Fdefine_key should cause keymaps to be autoloaded. 225 Fdefine_key should cause keymaps to be autoloaded.
226 226
227 This function can GC when AUTOLOAD is non-zero, because it calls 227 This function can GC when AUTOLOAD is non-zero, because it calls
228 do_autoload which can GC. */ 228 Fautoload_do_load which can GC. */
229 229
230Lisp_Object 230Lisp_Object
231get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload) 231get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
@@ -259,7 +259,7 @@ get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
259 struct gcpro gcpro1, gcpro2; 259 struct gcpro gcpro1, gcpro2;
260 260
261 GCPRO2 (tem, object); 261 GCPRO2 (tem, object);
262 do_autoload (tem, object); 262 Fautoload_do_load (tem, object, Qnil);
263 UNGCPRO; 263 UNGCPRO;
264 264
265 goto autoload_retry; 265 goto autoload_retry;
@@ -1854,7 +1854,7 @@ If KEYMAP is nil, that means no local keymap. */)
1854 if (!NILP (keymap)) 1854 if (!NILP (keymap))
1855 keymap = get_keymap (keymap, 1, 1); 1855 keymap = get_keymap (keymap, 1, 1);
1856 1856
1857 BVAR (current_buffer, keymap) = keymap; 1857 BSET (current_buffer, keymap, keymap);
1858 1858
1859 return Qnil; 1859 return Qnil;
1860} 1860}
@@ -2069,7 +2069,7 @@ The `kbd' macro is an approximate inverse of this. */)
2069 size += XINT (Flength (prefix)); 2069 size += XINT (Flength (prefix));
2070 2070
2071 /* This has one extra element at the end that we don't pass to Fconcat. */ 2071 /* This has one extra element at the end that we don't pass to Fconcat. */
2072 if (min (PTRDIFF_MAX, SIZE_MAX) / sizeof (Lisp_Object) / 4 < size) 2072 if (min (PTRDIFF_MAX, SIZE_MAX) / word_size / 4 < size)
2073 memory_full (SIZE_MAX); 2073 memory_full (SIZE_MAX);
2074 SAFE_ALLOCA_LISP (args, size * 4); 2074 SAFE_ALLOCA_LISP (args, size * 4);
2075 2075
@@ -2141,7 +2141,7 @@ The `kbd' macro is an approximate inverse of this. */)
2141 continue; 2141 continue;
2142 } 2142 }
2143 else 2143 else
2144 XSETINT (key, (XINT (key) | meta_modifier) & ~0x80); 2144 XSETINT (key, XINT (key) | meta_modifier);
2145 add_meta = 0; 2145 add_meta = 0;
2146 } 2146 }
2147 else if (EQ (key, meta_prefix_char)) 2147 else if (EQ (key, meta_prefix_char))
@@ -2304,11 +2304,10 @@ around function keys and event symbols. */)
2304 { 2304 {
2305 if (NILP (no_angles)) 2305 if (NILP (no_angles))
2306 { 2306 {
2307 char *buffer;
2308 Lisp_Object result; 2307 Lisp_Object result;
2309 USE_SAFE_ALLOCA; 2308 USE_SAFE_ALLOCA;
2310 SAFE_ALLOCA (buffer, char *, 2309 char *buffer = SAFE_ALLOCA (sizeof "<>"
2311 sizeof "<>" + SBYTES (SYMBOL_NAME (key))); 2310 + SBYTES (SYMBOL_NAME (key)));
2312 esprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key))); 2311 esprintf (buffer, "<%s>", SDATA (SYMBOL_NAME (key)));
2313 result = build_string (buffer); 2312 result = build_string (buffer);
2314 SAFE_FREE (); 2313 SAFE_FREE ();
@@ -3702,13 +3701,12 @@ syms_of_keymap (void)
3702 Fset (intern_c_string ("ctl-x-map"), control_x_map); 3701 Fset (intern_c_string ("ctl-x-map"), control_x_map);
3703 Ffset (intern_c_string ("Control-X-prefix"), control_x_map); 3702 Ffset (intern_c_string ("Control-X-prefix"), control_x_map);
3704 3703
3705 exclude_keys 3704 exclude_keys = listn (CONSTYPE_PURE, 5,
3706 = pure_cons (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")), 3705 pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")),
3707 pure_cons (pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")), 3706 pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")),
3708 pure_cons (pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")), 3707 pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")),
3709 pure_cons (pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")), 3708 pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")),
3710 pure_cons (pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" ")), 3709 pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" ")));
3711 Qnil)))));
3712 staticpro (&exclude_keys); 3710 staticpro (&exclude_keys);
3713 3711
3714 DEFVAR_LISP ("define-key-rebound-commands", Vdefine_key_rebound_commands, 3712 DEFVAR_LISP ("define-key-rebound-commands", Vdefine_key_rebound_commands,
@@ -3761,16 +3759,16 @@ be preferred. */);
3761 where_is_preferred_modifier = 0; 3759 where_is_preferred_modifier = 0;
3762 3760
3763 staticpro (&Vmouse_events); 3761 staticpro (&Vmouse_events);
3764 Vmouse_events = pure_cons (intern_c_string ("menu-bar"), 3762 Vmouse_events = listn (CONSTYPE_PURE, 9,
3765 pure_cons (intern_c_string ("tool-bar"), 3763 intern_c_string ("menu-bar"),
3766 pure_cons (intern_c_string ("header-line"), 3764 intern_c_string ("tool-bar"),
3767 pure_cons (intern_c_string ("mode-line"), 3765 intern_c_string ("header-line"),
3768 pure_cons (intern_c_string ("mouse-1"), 3766 intern_c_string ("mode-line"),
3769 pure_cons (intern_c_string ("mouse-2"), 3767 intern_c_string ("mouse-1"),
3770 pure_cons (intern_c_string ("mouse-3"), 3768 intern_c_string ("mouse-2"),
3771 pure_cons (intern_c_string ("mouse-4"), 3769 intern_c_string ("mouse-3"),
3772 pure_cons (intern_c_string ("mouse-5"), 3770 intern_c_string ("mouse-4"),
3773 Qnil))))))))); 3771 intern_c_string ("mouse-5"));
3774 3772
3775 DEFSYM (Qsingle_key_description, "single-key-description"); 3773 DEFSYM (Qsingle_key_description, "single-key-description");
3776 DEFSYM (Qkey_description, "key-description"); 3774 DEFSYM (Qkey_description, "key-description");