aboutsummaryrefslogtreecommitdiffstats
path: root/src/keymap.c
diff options
context:
space:
mode:
authorStefan Monnier2010-08-11 07:42:48 +0200
committerStefan Monnier2010-08-11 07:42:48 +0200
commitc566235d981eba73c88bbff00b6a1d88360b6e9f (patch)
treef8d653add3570fe750a83d1123ed35022e0bf4ef /src/keymap.c
parent0bfdb86f425a88fe43ebc88851c6f9a6418e1862 (diff)
parent490b89acab3e759426ede25c31c94268df55e925 (diff)
downloademacs-c566235d981eba73c88bbff00b6a1d88360b6e9f.tar.gz
emacs-c566235d981eba73c88bbff00b6a1d88360b6e9f.zip
Merge from trunk
Diffstat (limited to 'src/keymap.c')
-rw-r--r--src/keymap.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/keymap.c b/src/keymap.c
index 8a0c855e0dc..cc25d350d44 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -103,13 +103,6 @@ static Lisp_Object exclude_keys;
103/* Pre-allocated 2-element vector for Fcommand_remapping to use. */ 103/* Pre-allocated 2-element vector for Fcommand_remapping to use. */
104static Lisp_Object command_remapping_vector; 104static Lisp_Object command_remapping_vector;
105 105
106/* A char with the CHAR_META bit set in a vector or the 0200 bit set
107 in a string key sequence is equivalent to prefixing with this
108 character. */
109extern Lisp_Object meta_prefix_char;
110
111extern Lisp_Object Voverriding_local_map;
112
113/* Hash table used to cache a reverse-map to speed up calls to where-is. */ 106/* Hash table used to cache a reverse-map to speed up calls to where-is. */
114static Lisp_Object where_is_cache; 107static Lisp_Object where_is_cache;
115/* Which keymaps are reverse-stored in the cache. */ 108/* Which keymaps are reverse-stored in the cache. */
@@ -181,13 +174,13 @@ in case you use it as a menu with `x-popup-menu'. */)
181 initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */ 174 initial_define_key (control_x_map, Ctl('X'), "exchange-point-and-mark"); */
182 175
183void 176void
184initial_define_key (Lisp_Object keymap, int key, char *defname) 177initial_define_key (Lisp_Object keymap, int key, const char *defname)
185{ 178{
186 store_in_keymap (keymap, make_number (key), intern_c_string (defname)); 179 store_in_keymap (keymap, make_number (key), intern_c_string (defname));
187} 180}
188 181
189void 182void
190initial_define_lispy_key (Lisp_Object keymap, char *keyname, char *defname) 183initial_define_lispy_key (Lisp_Object keymap, const char *keyname, const char *defname)
191{ 184{
192 store_in_keymap (keymap, intern_c_string (keyname), intern_c_string (defname)); 185 store_in_keymap (keymap, intern_c_string (keyname), intern_c_string (defname));
193} 186}
@@ -1228,7 +1221,7 @@ binding KEY to DEF is added at the front of KEYMAP. */)
1228 && (!CONSP (c) 1221 && (!CONSP (c)
1229 /* If C is a range, it must be a leaf. */ 1222 /* If C is a range, it must be a leaf. */
1230 || (INTEGERP (XCAR (c)) && idx != length))) 1223 || (INTEGERP (XCAR (c)) && idx != length)))
1231 error ("Key sequence contains invalid event"); 1224 message_with_string ("Key sequence contains invalid event %s", c, 1);
1232 1225
1233 if (idx == length) 1226 if (idx == length)
1234 RETURN_UNGCPRO (store_in_keymap (keymap, c, def)); 1227 RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
@@ -1342,7 +1335,7 @@ recognize the default bindings, just as `read-key-sequence' does. */)
1342 /* Allow string since binding for `menu-bar-select-buffer' 1335 /* Allow string since binding for `menu-bar-select-buffer'
1343 includes the buffer name in the key sequence. */ 1336 includes the buffer name in the key sequence. */
1344 if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c) && !STRINGP (c)) 1337 if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c) && !STRINGP (c))
1345 error ("Key sequence contains invalid event"); 1338 message_with_string ("Key sequence contains invalid event %s", c, 1);
1346 1339
1347 cmd = access_keymap (keymap, c, t_ok, 0, 1); 1340 cmd = access_keymap (keymap, c, t_ok, 0, 1);
1348 if (idx == length) 1341 if (idx == length)
@@ -2969,7 +2962,7 @@ The optional argument MENUS, if non-nil, says to mention menu bindings.
2969 register Lisp_Object start1; 2962 register Lisp_Object start1;
2970 struct gcpro gcpro1; 2963 struct gcpro gcpro1;
2971 2964
2972 char *alternate_heading 2965 const char *alternate_heading
2973 = "\ 2966 = "\
2974Keyboard translations:\n\n\ 2967Keyboard translations:\n\n\
2975You type Translation\n\ 2968You type Translation\n\
@@ -3141,13 +3134,13 @@ You type Translation\n\
3141 3134
3142void 3135void
3143describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow, 3136describe_map_tree (Lisp_Object startmap, int partial, Lisp_Object shadow,
3144 Lisp_Object prefix, char *title, int nomenu, int transl, 3137 Lisp_Object prefix, const char *title, int nomenu, int transl,
3145 int always_title, int mention_shadow) 3138 int always_title, int mention_shadow)
3146{ 3139{
3147 Lisp_Object maps, orig_maps, seen, sub_shadows; 3140 Lisp_Object maps, orig_maps, seen, sub_shadows;
3148 struct gcpro gcpro1, gcpro2, gcpro3; 3141 struct gcpro gcpro1, gcpro2, gcpro3;
3149 int something = 0; 3142 int something = 0;
3150 char *key_heading 3143 const char *key_heading
3151 = "\ 3144 = "\
3152key binding\n\ 3145key binding\n\
3153--- -------\n"; 3146--- -------\n";