aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorJoakim Verona2012-07-27 02:22:03 +0200
committerJoakim Verona2012-07-27 02:22:03 +0200
commit5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f (patch)
tree5c55f1096a656a9759f0b53a0b5d1a2289bd366f /src/keymap.c
parent0c5c85cf2b350c965bb1ffa5b2d77c2adebc406b (diff)
parent562157c814037dcba58a20cd6908a95992c22283 (diff)
downloademacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.tar.gz
emacs-5fb63197843dcae66f2fe0ddd6f4a9d560e9db2f.zip
upstream
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c27
1 files changed, 11 insertions, 16 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 6c59a4a78d0..feaf0cfd961 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -92,7 +92,6 @@ static Lisp_Object where_is_cache;
92/* Which keymaps are reverse-stored in the cache. */ 92/* Which keymaps are reverse-stored in the cache. */
93static Lisp_Object where_is_cache_keymaps; 93static Lisp_Object where_is_cache_keymaps;
94 94
95static Lisp_Object Flookup_key (Lisp_Object, Lisp_Object, Lisp_Object);
96static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object); 95static Lisp_Object store_in_keymap (Lisp_Object, Lisp_Object, Lisp_Object);
97 96
98static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object); 97static Lisp_Object define_as_prefix (Lisp_Object, Lisp_Object);
@@ -226,7 +225,7 @@ when reading a key-sequence to be looked-up in this keymap. */)
226 Fdefine_key should cause keymaps to be autoloaded. 225 Fdefine_key should cause keymaps to be autoloaded.
227 226
228 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
229 do_autoload which can GC. */ 228 Fautoload_do_load which can GC. */
230 229
231Lisp_Object 230Lisp_Object
232get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload) 231get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
@@ -260,7 +259,7 @@ get_keymap (Lisp_Object object, int error_if_not_keymap, int autoload)
260 struct gcpro gcpro1, gcpro2; 259 struct gcpro gcpro1, gcpro2;
261 260
262 GCPRO2 (tem, object); 261 GCPRO2 (tem, object);
263 do_autoload (tem, object); 262 Fautoload_do_load (tem, object, Qnil);
264 UNGCPRO; 263 UNGCPRO;
265 264
266 goto autoload_retry; 265 goto autoload_retry;
@@ -956,8 +955,6 @@ store_in_keymap (Lisp_Object keymap, register Lisp_Object idx, Lisp_Object def)
956 return def; 955 return def;
957} 956}
958 957
959static Lisp_Object Fcopy_keymap (Lisp_Object);
960
961static Lisp_Object 958static Lisp_Object
962copy_keymap_item (Lisp_Object elt) 959copy_keymap_item (Lisp_Object elt)
963{ 960{
@@ -1481,7 +1478,7 @@ current_minor_maps (Lisp_Object **modeptr, Lisp_Object **mapptr)
1481 /* Use malloc here. See the comment above this function. 1478 /* Use malloc here. See the comment above this function.
1482 Avoid realloc here; it causes spurious traps on GNU/Linux [KFS] */ 1479 Avoid realloc here; it causes spurious traps on GNU/Linux [KFS] */
1483 BLOCK_INPUT; 1480 BLOCK_INPUT;
1484 newmodes = (Lisp_Object *) malloc (allocsize); 1481 newmodes = malloc (allocsize);
1485 if (newmodes) 1482 if (newmodes)
1486 { 1483 {
1487 if (cmm_modes) 1484 if (cmm_modes)
@@ -1493,7 +1490,7 @@ current_minor_maps (Lisp_Object **modeptr, Lisp_Object **mapptr)
1493 cmm_modes = newmodes; 1490 cmm_modes = newmodes;
1494 } 1491 }
1495 1492
1496 newmaps = (Lisp_Object *) malloc (allocsize); 1493 newmaps = malloc (allocsize);
1497 if (newmaps) 1494 if (newmaps)
1498 { 1495 {
1499 if (cmm_maps) 1496 if (cmm_maps)
@@ -2013,9 +2010,7 @@ then the value includes only maps for prefixes that start with PREFIX. */)
2013 return Qnil; 2010 return Qnil;
2014 } 2011 }
2015 else 2012 else
2016 maps = Fcons (Fcons (Fmake_vector (make_number (0), Qnil), 2013 maps = Fcons (Fcons (zero_vector, get_keymap (keymap, 1, 0)), Qnil);
2017 get_keymap (keymap, 1, 0)),
2018 Qnil);
2019 2014
2020 /* For each map in the list maps, 2015 /* For each map in the list maps,
2021 look at any other maps it points to, 2016 look at any other maps it points to,
@@ -2926,7 +2921,7 @@ You type Translation\n\
2926 if (!SYMBOLP (modes[i])) 2921 if (!SYMBOLP (modes[i]))
2927 abort (); 2922 abort ();
2928 2923
2929 p = title = (char *) alloca (42 + SCHARS (SYMBOL_NAME (modes[i]))); 2924 p = title = alloca (42 + SCHARS (SYMBOL_NAME (modes[i])));
2930 *p++ = '\f'; 2925 *p++ = '\f';
2931 *p++ = '\n'; 2926 *p++ = '\n';
2932 *p++ = '`'; 2927 *p++ = '`';
@@ -3708,11 +3703,11 @@ syms_of_keymap (void)
3708 Ffset (intern_c_string ("Control-X-prefix"), control_x_map); 3703 Ffset (intern_c_string ("Control-X-prefix"), control_x_map);
3709 3704
3710 exclude_keys 3705 exclude_keys
3711 = pure_cons (pure_cons (make_pure_c_string ("DEL"), make_pure_c_string ("\\d")), 3706 = pure_cons (pure_cons (build_pure_c_string ("DEL"), build_pure_c_string ("\\d")),
3712 pure_cons (pure_cons (make_pure_c_string ("TAB"), make_pure_c_string ("\\t")), 3707 pure_cons (pure_cons (build_pure_c_string ("TAB"), build_pure_c_string ("\\t")),
3713 pure_cons (pure_cons (make_pure_c_string ("RET"), make_pure_c_string ("\\r")), 3708 pure_cons (pure_cons (build_pure_c_string ("RET"), build_pure_c_string ("\\r")),
3714 pure_cons (pure_cons (make_pure_c_string ("ESC"), make_pure_c_string ("\\e")), 3709 pure_cons (pure_cons (build_pure_c_string ("ESC"), build_pure_c_string ("\\e")),
3715 pure_cons (pure_cons (make_pure_c_string ("SPC"), make_pure_c_string (" ")), 3710 pure_cons (pure_cons (build_pure_c_string ("SPC"), build_pure_c_string (" ")),
3716 Qnil))))); 3711 Qnil)))));
3717 staticpro (&exclude_keys); 3712 staticpro (&exclude_keys);
3718 3713