comparison src/keymap.c @ 29716:8797e25c4231

fix shadowing of 'keymap' enum value
author Ken Raeburn <raeburn@raeburn.org>
date Sun, 18 Jun 2000 20:14:35 +0000
parents 5201e6953968
children c9430bc1c824
comparison
equal deleted inserted replaced
29715:456f38737c9a 29716:8797e25c4231
2061 and entirely reject menu bindings.\n\ 2061 and entirely reject menu bindings.\n\
2062 \n\ 2062 \n\
2063 If optional 4th arg NOINDIRECT is non-nil, don't follow indirections\n\ 2063 If optional 4th arg NOINDIRECT is non-nil, don't follow indirections\n\
2064 to other keymaps or slots. This makes it possible to search for an\n\ 2064 to other keymaps or slots. This makes it possible to search for an\n\
2065 indirect definition itself.") 2065 indirect definition itself.")
2066 (definition, keymap, firstonly, noindirect) 2066 (definition, xkeymap, firstonly, noindirect)
2067 Lisp_Object definition, keymap; 2067 Lisp_Object definition, xkeymap;
2068 Lisp_Object firstonly, noindirect; 2068 Lisp_Object firstonly, noindirect;
2069 { 2069 {
2070 Lisp_Object maps; 2070 Lisp_Object maps;
2071 Lisp_Object found, sequences; 2071 Lisp_Object found, sequences;
2072 Lisp_Object keymap1; 2072 Lisp_Object keymap1;
2073 int keymap_specified = !NILP (keymap); 2073 int keymap_specified = !NILP (xkeymap);
2074 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5; 2074 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
2075 /* 1 means ignore all menu bindings entirely. */ 2075 /* 1 means ignore all menu bindings entirely. */
2076 int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii); 2076 int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
2077 2077
2078 /* Find keymaps accessible from `keymap' or the current 2078 /* Find keymaps accessible from `keymap' or the current
2079 context. But don't muck with the value of `keymap', 2079 context. But don't muck with the value of `keymap',
2080 because `where_is_internal_1' uses it to check for 2080 because `where_is_internal_1' uses it to check for
2081 shadowed bindings. */ 2081 shadowed bindings. */
2082 keymap1 = keymap; 2082 keymap1 = xkeymap;
2083 if (! keymap_specified) 2083 if (! keymap_specified)
2084 keymap1 = get_local_map (PT, current_buffer, keymap); 2084 keymap1 = get_local_map (PT, current_buffer, keymap);
2085 2085
2086 if (!NILP (keymap1)) 2086 if (!NILP (keymap1))
2087 maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil), 2087 maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil),
2088 Faccessible_keymaps (get_keymap (current_global_map), 2088 Faccessible_keymaps (get_keymap (current_global_map),
2089 Qnil)); 2089 Qnil));
2090 else 2090 else
2091 { 2091 {
2092 keymap1 = keymap; 2092 keymap1 = xkeymap;
2093 if (! keymap_specified) 2093 if (! keymap_specified)
2094 keymap1 = get_local_map (PT, current_buffer, local_map); 2094 keymap1 = get_local_map (PT, current_buffer, local_map);
2095 2095
2096 if (!NILP (keymap1)) 2096 if (!NILP (keymap1))
2097 maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil), 2097 maps = nconc2 (Faccessible_keymaps (get_keymap (keymap1), Qnil),
2113 maps); 2113 maps);
2114 minors = XCDR (minors); 2114 minors = XCDR (minors);
2115 } 2115 }
2116 } 2116 }
2117 2117
2118 GCPRO5 (definition, keymap, maps, found, sequences); 2118 GCPRO5 (definition, xkeymap, maps, found, sequences);
2119 found = Qnil; 2119 found = Qnil;
2120 sequences = Qnil; 2120 sequences = Qnil;
2121 2121
2122 for (; !NILP (maps); maps = Fcdr (maps)) 2122 for (; !NILP (maps); maps = Fcdr (maps))
2123 { 2123 {
2166 for (i = 0; i < XVECTOR (elt)->size; i++) 2166 for (i = 0; i < XVECTOR (elt)->size; i++)
2167 { 2167 {
2168 binding = XVECTOR (elt)->contents[i]; 2168 binding = XVECTOR (elt)->contents[i];
2169 XSETFASTINT (key, i); 2169 XSETFASTINT (key, i);
2170 sequence = where_is_internal_1 (binding, key, definition, 2170 sequence = where_is_internal_1 (binding, key, definition,
2171 noindirect, keymap, this, 2171 noindirect, xkeymap, this,
2172 last, nomenus, last_is_meta); 2172 last, nomenus, last_is_meta);
2173 if (!NILP (sequence)) 2173 if (!NILP (sequence))
2174 sequences = Fcons (sequence, sequences); 2174 sequences = Fcons (sequence, sequences);
2175 } 2175 }
2176 } 2176 }
2178 { 2178 {
2179 Lisp_Object indices[3]; 2179 Lisp_Object indices[3];
2180 Lisp_Object args; 2180 Lisp_Object args;
2181 2181
2182 args = Fcons (Fcons (Fcons (definition, noindirect), 2182 args = Fcons (Fcons (Fcons (definition, noindirect),
2183 Fcons (keymap, Qnil)), 2183 Fcons (xkeymap, Qnil)),
2184 Fcons (Fcons (this, last), 2184 Fcons (Fcons (this, last),
2185 Fcons (make_number (nomenus), 2185 Fcons (make_number (nomenus),
2186 make_number (last_is_meta)))); 2186 make_number (last_is_meta))));
2187 2187
2188 map_char_table (where_is_internal_2, Qnil, elt, args, 2188 map_char_table (where_is_internal_2, Qnil, elt, args,
2195 2195
2196 key = XCAR (elt); 2196 key = XCAR (elt);
2197 binding = XCDR (elt); 2197 binding = XCDR (elt);
2198 2198
2199 sequence = where_is_internal_1 (binding, key, definition, 2199 sequence = where_is_internal_1 (binding, key, definition,
2200 noindirect, keymap, this, 2200 noindirect, xkeymap, this,
2201 last, nomenus, last_is_meta); 2201 last, nomenus, last_is_meta);
2202 if (!NILP (sequence)) 2202 if (!NILP (sequence))
2203 sequences = Fcons (sequence, sequences); 2203 sequences = Fcons (sequence, sequences);
2204 } 2204 }
2205 2205