minibuf */
/* was MinibufLocalNSMap */
-Lisp_Object Vminibuffer_local_ns_map;
+Lisp_Object Vminibuffer_local_ns_map;
/* The keymap used by the minibuf for local
bindings when spaces are not encouraged
in the minibuf */
when Emacs starts up. t means don't record anything here. */
Lisp_Object Vdefine_key_rebound_commands;
-Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item;
+Lisp_Object Qkeymapp, Qkeymap, Qnon_ascii, Qmenu_item, Qremap;
+
+/* Alist of elements like (DEL . "\d"). */
+static Lisp_Object exclude_keys;
+
+/* Pre-allocated 2-element vector for Fremap_command to use. */
+static Lisp_Object remap_command_vector;
/* A char with the CHAR_META bit set in a vector or the 0200 bit set
in a string key sequence is equivalent to prefixing with this
static void fix_submap_inheritance P_ ((Lisp_Object, Lisp_Object, Lisp_Object));
static Lisp_Object define_as_prefix P_ ((Lisp_Object, Lisp_Object));
-static void describe_command P_ ((Lisp_Object));
-static void describe_translation P_ ((Lisp_Object));
+static void describe_command P_ ((Lisp_Object, Lisp_Object));
+static void describe_translation P_ ((Lisp_Object, Lisp_Object));
static void describe_map P_ ((Lisp_Object, Lisp_Object,
- void (*) P_ ((Lisp_Object)),
+ void (*) P_ ((Lisp_Object, Lisp_Object)),
int, Lisp_Object, Lisp_Object*, int));
+static void silly_event_symbol_error P_ ((Lisp_Object));
\f
/* Keymap object support - constructors and predicates. */
else if (CONSP (binding))
{
Lisp_Object key = XCAR (binding);
- int c1, c2;
if (EQ (key, idx))
val = XCDR (binding);
/* Character codes with modifiers
are not included in a char-table.
All character codes without modifiers are included. */
- if (NATNUMP (idx)
- && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0)
- val = Faref (binding, idx);
+ if (NATNUMP (idx) && (XFASTINT (idx) & CHAR_MODIFIER_MASK) == 0)
+ {
+ val = Faref (binding, idx);
+ /* `nil' has a special meaning for char-tables, so
+ we use something else to record an explicitly
+ unbound entry. */
+ if (NILP (val))
+ val = Qunbound;
+ }
}
/* If we found a binding, clean it up and return it. */
if (!EQ (val, Qunbound))
{
+ if (EQ (val, Qt))
+ /* A Qt binding is just like an explicit nil binding
+ (i.e. it shadows any parent binding but not bindings in
+ keymaps of lower precedence). */
+ val = Qnil;
val = get_keyelt (val, autoload);
if (KEYMAPP (val))
fix_submap_inheritance (map, idx, val);
/* Character codes with modifiers
are not included in a char-table.
All character codes without modifiers are included. */
- if (NATNUMP (idx)
- && ! (XFASTINT (idx)
- & (CHAR_ALT | CHAR_SUPER | CHAR_HYPER
- | CHAR_SHIFT | CHAR_CTL | CHAR_META)))
+ if (NATNUMP (idx) && !(XFASTINT (idx) & CHAR_MODIFIER_MASK))
{
- Faset (elt, idx, def);
+ Faset (elt, idx,
+ /* `nil' has a special meaning for char-tables, so
+ we use something else to record an explicitly
+ unbound entry. */
+ NILP (def) ? Qt : def);
return def;
}
insertion_point = tail;
DEFUN ("define-key", Fdefine_key, Sdefine_key, 3, 3, 0,
doc: /* Args KEYMAP, KEY, DEF. Define key sequence KEY, in KEYMAP, as DEF.
-KEYMAP is a keymap. KEY is a string or a vector of symbols and characters
-meaning a sequence of keystrokes and events.
-Non-ASCII characters with codes above 127 (such as ISO Latin-1)
-can be included if you use a vector.
+KEYMAP is a keymap.
+
+KEY is a string or a vector of symbols and characters meaning a
+sequence of keystrokes and events. Non-ASCII characters with codes
+above 127 (such as ISO Latin-1) can be included if you use a vector.
+
DEF is anything that can be a key's definition:
nil (means key is undefined in this keymap),
a command (a Lisp function suitable for interactive calling)
keymap = get_keymap (keymap, 1, 1);
if (!VECTORP (key) && !STRINGP (key))
- key = wrong_type_argument (Qarrayp, key);
+ key = wrong_type_argument (Qarrayp, key);
length = XFASTINT (Flength (key));
if (length == 0)
return Qnil;
+ /* Check for valid [remap COMMAND] bindings. */
+ if (VECTORP (key) && EQ (AREF (key, 0), Qremap)
+ && (length != 2 || !SYMBOLP (AREF (key, 1))))
+ wrong_type_argument (Qvectorp, key);
+
if (SYMBOLP (def) && !EQ (Vdefine_key_rebound_commands, Qt))
Vdefine_key_rebound_commands = Fcons (def, Vdefine_key_rebound_commands);
if (CONSP (c) && lucid_event_type_list_p (c))
c = Fevent_convert_list (c);
+ if (SYMBOLP (c))
+ silly_event_symbol_error (c);
+
if (INTEGERP (c)
&& (XINT (c) & meta_bit)
&& !metized)
}
if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c))
- error ("Key sequence contains invalid events");
+ error ("Key sequence contains invalid event");
if (idx == length)
RETURN_UNGCPRO (store_in_keymap (keymap, c, def));
}
}
-/* Value is number if KEY is too long; NIL if valid but has no definition. */
+/* This function may GC (it calls Fkey_binding). */
+
+DEFUN ("remap-command", Fremap_command, Sremap_command, 1, 1, 0,
+ doc: /* Return the remapping for command COMMAND in current keymaps.
+Returns nil if COMMAND is not remapped. */)
+ (command)
+ Lisp_Object command;
+{
+ /* This will GCPRO the command argument. */
+ ASET (remap_command_vector, 1, command);
+ return Fkey_binding (remap_command_vector, Qnil, Qt);
+}
+
+/* Value is number if KEY is too long; nil if valid but has no definition. */
/* GC is possible in this function if it autoloads a keymap. */
DEFUN ("lookup-key", Flookup_key, Slookup_key, 2, 3, 0,
keymap = get_keymap (keymap, 1, 1);
+ /* Perform command remapping initiated by Fremap_command directly.
+ This is strictly not necessary, but it is faster and it returns
+ nil instead of 1 if KEYMAP doesn't contain command remappings. */
+ if (EQ (key, remap_command_vector))
+ {
+ /* KEY has format [remap COMMAND].
+ Lookup `remap' in KEYMAP; result is nil or a keymap containing
+ command remappings. Then lookup COMMAND in that keymap. */
+ if ((keymap = access_keymap (keymap, Qremap, t_ok, 0, 1), !NILP (keymap))
+ && (keymap = get_keymap (keymap, 0, 1), CONSP (keymap)))
+ return access_keymap (keymap, AREF (key, 1), t_ok, 0, 1);
+ return Qnil;
+ }
+
if (!VECTORP (key) && !STRINGP (key))
key = wrong_type_argument (Qarrayp, key);
if (XINT (c) & 0x80 && STRINGP (key))
XSETINT (c, (XINT (c) | meta_modifier) & ~0x80);
+ /* Allow string since binding for `menu-bar-select-buffer'
+ includes the buffer name in the key sequence. */
+ if (!INTEGERP (c) && !SYMBOLP (c) && !CONSP (c) && !STRINGP (c))
+ error ("Key sequence contains invalid event");
+
cmd = access_keymap (keymap, c, t_ok, 0, 1);
if (idx == length)
RETURN_UNGCPRO (cmd);
return Fvconcat (2, args);
}
+/* Given a event type C which is a symbol,
+ signal an error if is a mistake such as RET or M-RET or C-DEL, etc. */
+
+static void
+silly_event_symbol_error (c)
+ Lisp_Object c;
+{
+ Lisp_Object parsed, base, name, assoc;
+ int modifiers;
+
+ parsed = parse_modifiers (c);
+ modifiers = (int) XUINT (XCAR (XCDR (parsed)));
+ base = XCAR (parsed);
+ name = Fsymbol_name (base);
+ /* This alist includes elements such as ("RET" . "\\r"). */
+ assoc = Fassoc (name, exclude_keys);
+
+ if (! NILP (assoc))
+ {
+ char new_mods[sizeof ("\\A-\\C-\\H-\\M-\\S-\\s-")];
+ char *p = new_mods;
+ Lisp_Object keystring;
+ if (modifiers & alt_modifier)
+ { *p++ = '\\'; *p++ = 'A'; *p++ = '-'; }
+ if (modifiers & ctrl_modifier)
+ { *p++ = '\\'; *p++ = 'C'; *p++ = '-'; }
+ if (modifiers & hyper_modifier)
+ { *p++ = '\\'; *p++ = 'H'; *p++ = '-'; }
+ if (modifiers & meta_modifier)
+ { *p++ = '\\'; *p++ = 'M'; *p++ = '-'; }
+ if (modifiers & shift_modifier)
+ { *p++ = '\\'; *p++ = 'S'; *p++ = '-'; }
+ if (modifiers & super_modifier)
+ { *p++ = '\\'; *p++ = 's'; *p++ = '-'; }
+ *p = 0;
+
+ c = reorder_modifiers (c);
+ keystring = concat2 (build_string (new_mods), XCDR (assoc));
+
+ error ((modifiers & ~meta_modifier
+ ? "To bind the key %s, use [?%s], not [%s]"
+ : "To bind the key %s, use \"%s\", not [%s]"),
+ XSYMBOL (c)->name->data, XSTRING (keystring)->data,
+ XSYMBOL (c)->name->data);
+ }
+}
\f
/* Global, local, and minor mode keymap stuff. */
if (!NILP (local))
keymaps = Fcons (local, keymaps);
- local = get_local_map (PT, current_buffer, Qkeymap);
- if (!NILP (local))
- keymaps = Fcons (local, keymaps);
-
nmaps = current_minor_maps (0, &maps);
for (i = --nmaps; i >= 0; i--)
if (!NILP (maps[i]))
keymaps = Fcons (maps[i], keymaps);
+
+ local = get_local_map (PT, current_buffer, Qkeymap);
+ if (!NILP (local))
+ keymaps = Fcons (local, keymaps);
}
return keymaps;
/* GC is possible in this function if it autoloads a keymap. */
-DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 2, 0,
+DEFUN ("key-binding", Fkey_binding, Skey_binding, 1, 3, 0,
doc: /* Return the binding for command KEY in current keymaps.
KEY is a string or vector, a sequence of keystrokes.
The binding is probably a symbol with a function definition.
bindings, used when nothing else in the keymap applies; this makes it
usable as a general function for probing keymaps. However, if the
optional second argument ACCEPT-DEFAULT is non-nil, `key-binding' does
-recognize the default bindings, just as `read-key-sequence' does. */)
- (key, accept_default)
- Lisp_Object key, accept_default;
+recognize the default bindings, just as `read-key-sequence' does.
+
+Like the normal command loop, `key-binding' will remap the command
+resulting from looking up KEY by looking up the command in the
+currrent keymaps. However, if the optional third argument NO-REMAP
+is non-nil, `key-binding' returns the unmapped command. */)
+ (key, accept_default, no_remap)
+ Lisp_Object key, accept_default, no_remap;
{
Lisp_Object *maps, value;
int nmaps, i;
value = Flookup_key (current_kboard->Voverriding_terminal_local_map,
key, accept_default);
if (! NILP (value) && !INTEGERP (value))
- RETURN_UNGCPRO (value);
+ goto done;
}
else if (!NILP (Voverriding_local_map))
{
value = Flookup_key (Voverriding_local_map, key, accept_default);
if (! NILP (value) && !INTEGERP (value))
- RETURN_UNGCPRO (value);
+ goto done;
}
else
{
Lisp_Object local;
+ local = get_local_map (PT, current_buffer, Qkeymap);
+ if (! NILP (local))
+ {
+ value = Flookup_key (local, key, accept_default);
+ if (! NILP (value) && !INTEGERP (value))
+ goto done;
+ }
+
nmaps = current_minor_maps (0, &maps);
/* Note that all these maps are GCPRO'd
in the places where we found them. */
{
value = Flookup_key (maps[i], key, accept_default);
if (! NILP (value) && !INTEGERP (value))
- RETURN_UNGCPRO (value);
+ goto done;
}
- local = get_local_map (PT, current_buffer, Qkeymap);
- if (! NILP (local))
- {
- value = Flookup_key (local, key, accept_default);
- if (! NILP (value) && !INTEGERP (value))
- RETURN_UNGCPRO (value);
- }
-
local = get_local_map (PT, current_buffer, Qlocal_map);
-
if (! NILP (local))
{
value = Flookup_key (local, key, accept_default);
if (! NILP (value) && !INTEGERP (value))
- RETURN_UNGCPRO (value);
+ goto done;
}
}
value = Flookup_key (current_global_map, key, accept_default);
+
+ done:
UNGCPRO;
- if (! NILP (value) && !INTEGERP (value))
- return value;
+ if (NILP (value) || INTEGERP (value))
+ return Qnil;
+
+ /* If the result of the ordinary keymap lookup is an interactive
+ command, look for a key binding (ie. remapping) for that command. */
+
+ if (NILP (no_remap) && SYMBOLP (value))
+ {
+ Lisp_Object value1;
+ if (value1 = Fremap_command (value), !NILP (value1))
+ value = value1;
+ }
- return Qnil;
+ return value;
}
/* GC is possible in this function if it autoloads a keymap. */
p += CHAR_STRING (c, p);
}
- return p;
+ return p;
}
/* This function cannot GC. */
}
else
*p++ = c;
- return p;
+ return p;
}
/* This function cannot GC. */
\f
/* where-is - finding a command in a set of keymaps. */
+static Lisp_Object where_is_internal ();
static Lisp_Object where_is_internal_1 ();
static void where_is_internal_2 ();
/* This function can GC if Flookup_key autoloads any keymaps. */
static Lisp_Object
-where_is_internal (definition, keymaps, firstonly, noindirect)
+where_is_internal (definition, keymaps, firstonly, noindirect, no_remap)
Lisp_Object definition, keymaps;
- Lisp_Object firstonly, noindirect;
+ Lisp_Object firstonly, noindirect, no_remap;
{
Lisp_Object maps = Qnil;
Lisp_Object found, sequences;
/* 1 means ignore all menu bindings entirely. */
int nomenus = !NILP (firstonly) && !EQ (firstonly, Qnon_ascii);
+ /* If this command is remapped, then it has no key bindings
+ of its own. */
+ if (NILP (no_remap) && SYMBOLP (definition))
+ {
+ Lisp_Object tem;
+ if (tem = Fremap_command (definition), !NILP (tem))
+ return Qnil;
+ }
+
found = keymaps;
while (CONSP (found))
{
}
- for (; !NILP (sequences); sequences = XCDR (sequences))
+ while (!NILP (sequences))
{
- Lisp_Object sequence;
+ Lisp_Object sequence, remapped, function;
sequence = XCAR (sequences);
+ sequences = XCDR (sequences);
+
+ /* If the current sequence is a command remapping with
+ format [remap COMMAND], find the key sequences
+ which run COMMAND, and use those sequences instead. */
+ remapped = Qnil;
+ if (NILP (no_remap)
+ && VECTORP (sequence) && XVECTOR (sequence)->size == 2
+ && EQ (AREF (sequence, 0), Qremap)
+ && (function = AREF (sequence, 1), SYMBOLP (function)))
+ {
+ Lisp_Object remapped1;
+
+ remapped1 = where_is_internal (function, keymaps, firstonly, noindirect, Qt);
+ if (CONSP (remapped1))
+ {
+ /* Verify that this key binding actually maps to the
+ remapped command (see below). */
+ if (!EQ (shadow_lookup (keymaps, XCAR (remapped1), Qnil), function))
+ continue;
+ sequence = XCAR (remapped1);
+ remapped = XCDR (remapped1);
+ goto record_sequence;
+ }
+ }
/* Verify that this key binding is not shadowed by another
binding for the same key, before we say it exists.
if (!EQ (shadow_lookup (keymaps, sequence, Qnil), definition))
continue;
+ record_sequence:
/* It is a true unshadowed match. Record it, unless it's already
been seen (as could happen when inheriting keymaps). */
if (NILP (Fmember (sequence, found)))
RETURN_UNGCPRO (sequence);
else if (!NILP (firstonly) && ascii_sequence_p (sequence))
RETURN_UNGCPRO (sequence);
+
+ if (CONSP (remapped))
+ {
+ sequence = XCAR (remapped);
+ remapped = XCDR (remapped);
+ goto record_sequence;
+ }
}
}
}
return found;
}
-DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 4, 0,
+DEFUN ("where-is-internal", Fwhere_is_internal, Swhere_is_internal, 1, 5, 0,
doc: /* Return list of keys that invoke DEFINITION.
If KEYMAP is non-nil, search only KEYMAP and the global keymap.
If KEYMAP is nil, search all the currently active keymaps.
If optional 4th arg NOINDIRECT is non-nil, don't follow indirections
to other keymaps or slots. This makes it possible to search for an
-indirect definition itself. */)
- (definition, keymap, firstonly, noindirect)
+indirect definition itself.
+
+If optional 5th arg NO-REMAP is non-nil, don't search for key sequences
+that invoke a command which is remapped to DEFINITION, but include the
+remapped command in the returned list. */)
+ (definition, keymap, firstonly, noindirect, no_remap)
Lisp_Object definition, keymap;
- Lisp_Object firstonly, noindirect;
+ Lisp_Object firstonly, noindirect, no_remap;
{
Lisp_Object sequences, keymaps;
/* 1 means ignore all menu bindings entirely. */
{
Lisp_Object *defns;
int i, j, n;
- struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
+ struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
/* Check heuristic-consistency of the cache. */
if (NILP (Fequal (keymaps, where_is_cache_keymaps)))
where_is_cache_keymaps = Qt;
/* Fill in the cache. */
- GCPRO4 (definition, keymaps, firstonly, noindirect);
- where_is_internal (definition, keymaps, firstonly, noindirect);
+ GCPRO5 (definition, keymaps, firstonly, noindirect, no_remap);
+ where_is_internal (definition, keymaps, firstonly, noindirect, no_remap);
UNGCPRO;
where_is_cache_keymaps = keymaps;
/* Kill the cache so that where_is_internal_1 doesn't think
we're filling it up. */
where_is_cache = Qnil;
- result = where_is_internal (definition, keymaps, firstonly, noindirect);
+ result = where_is_internal (definition, keymaps, firstonly, noindirect, no_remap);
}
return result;
nmaps = current_minor_maps (&modes, &maps);
Fset_buffer (outbuf);
+ start1 = get_local_map (BUF_PT (XBUFFER (buffer)),
+ XBUFFER (buffer), Qkeymap);
+ if (!NILP (start1))
+ {
+ describe_map_tree (start1, 1, shadow, prefix,
+ "\f\n`keymap' Property Bindings", nomenu, 0, 0);
+ shadow = Fcons (start1, shadow);
+ }
+
/* Print the minor mode maps. */
for (i = 0; i < nmaps; i++)
{
shadow = Fcons (maps[i], shadow);
}
- start1 = get_local_map (BUF_PT (XBUFFER (buffer)),
- XBUFFER (buffer), Qkeymap);
- if (!NILP (start1))
- {
- describe_map_tree (start1, 1, shadow, prefix,
- "\f\nChar Property Bindings", nomenu, 0, 0);
- shadow = Fcons (start1, shadow);
- }
-
start1 = get_local_map (BUF_PT (XBUFFER (buffer)),
XBUFFER (buffer), Qlocal_map);
if (!NILP (start1))
"\f\nMajor Mode Bindings", nomenu, 0, 0);
else
describe_map_tree (start1, 1, shadow, prefix,
- "\f\nChar Property Bindings", nomenu, 0, 0);
+ "\f\n`local-map' Property Bindings",
+ nomenu, 0, 0);
shadow = Fcons (start1, shadow);
}
static int previous_description_column;
static void
-describe_command (definition)
- Lisp_Object definition;
+describe_command (definition, args)
+ Lisp_Object definition, args;
{
register Lisp_Object tem1;
int column = current_column ();
}
static void
-describe_translation (definition)
- Lisp_Object definition;
+describe_translation (definition, args)
+ Lisp_Object definition, args;
{
register Lisp_Object tem1;
describe_map (map, keys, elt_describer, partial, shadow, seen, nomenu)
register Lisp_Object map;
Lisp_Object keys;
- void (*elt_describer) P_ ((Lisp_Object));
+ void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
int partial;
Lisp_Object shadow;
Lisp_Object *seen;
if (VECTORP (XCAR (tail))
|| CHAR_TABLE_P (XCAR (tail)))
describe_vector (XCAR (tail),
- elt_prefix, elt_describer, partial, shadow, map,
+ elt_prefix, Qnil, elt_describer, partial, shadow, map,
(int *)0, 0);
else if (CONSP (XCAR (tail)))
{
/* Print a description of the definition of this character.
elt_describer will take care of spacing out far enough
for alignment purposes. */
- (*elt_describer) (definition);
+ (*elt_describer) (definition, Qnil);
}
else if (EQ (XCAR (tail), Qkeymap))
{
}
static void
-describe_vector_princ (elt)
- Lisp_Object elt;
+describe_vector_princ (elt, fun)
+ Lisp_Object elt, fun;
{
Findent_to (make_number (16), make_number (1));
- Fprinc (elt, Qnil);
+ call1 (fun, elt);
Fterpri (Qnil);
}
-DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 1, 0,
+DEFUN ("describe-vector", Fdescribe_vector, Sdescribe_vector, 1, 2, 0,
doc: /* Insert a description of contents of VECTOR.
This is text showing the elements of vector matched against indices. */)
- (vector)
- Lisp_Object vector;
+ (vector, describer)
+ Lisp_Object vector, describer;
{
int count = specpdl_ptr - specpdl;
-
+ if (NILP (describer))
+ describer = intern ("princ");
specbind (Qstandard_output, Fcurrent_buffer ());
CHECK_VECTOR_OR_CHAR_TABLE (vector);
- describe_vector (vector, Qnil, describe_vector_princ, 0,
+ describe_vector (vector, Qnil, describer, describe_vector_princ, 0,
Qnil, Qnil, (int *)0, 0);
return unbind_to (count, Qnil);
When describing a sub-char-table, INDICES is a list of
indices at higher levels in this char-table,
- and CHAR_TABLE_DEPTH says how many levels down we have gone. */
+ and CHAR_TABLE_DEPTH says how many levels down we have gone.
+
+ ARGS is simply passed as the second argument to ELT_DESCRIBER. */
void
-describe_vector (vector, elt_prefix, elt_describer,
+describe_vector (vector, elt_prefix, args, elt_describer,
partial, shadow, entire_map,
indices, char_table_depth)
register Lisp_Object vector;
- Lisp_Object elt_prefix;
- void (*elt_describer) P_ ((Lisp_Object));
+ Lisp_Object elt_prefix, args;
+ void (*elt_describer) P_ ((Lisp_Object, Lisp_Object));
int partial;
Lisp_Object shadow;
Lisp_Object entire_map;
else
definition = get_keyelt (AREF (vector, i), 0);
- if (NILP (definition)) continue;
+ if (NILP (definition)) continue;
/* Don't mention suppressed commands. */
if (SYMBOLP (definition) && partial)
if (CHAR_TABLE_P (vector) && SUB_CHAR_TABLE_P (definition))
{
insert ("\n", 1);
- describe_vector (definition, elt_prefix, elt_describer,
+ describe_vector (definition, elt_prefix, args, elt_describer,
partial, shadow, entire_map,
indices, char_table_depth + 1);
continue;
/* Print a description of the definition of this character.
elt_describer will take care of spacing out far enough
for alignment purposes. */
- (*elt_describer) (definition);
+ (*elt_describer) (definition, args);
}
/* For (sub) char-table, print `defalt' slot at last. */
{
insert (" ", char_table_depth * 2);
insert_string ("<<default>>");
- (*elt_describer) (XCHAR_TABLE (vector)->defalt);
+ (*elt_describer) (XCHAR_TABLE (vector)->defalt, args);
}
UNGCPRO;
Fset (intern ("ctl-x-map"), control_x_map);
Ffset (intern ("Control-X-prefix"), control_x_map);
+ exclude_keys
+ = Fcons (Fcons (build_string ("DEL"), build_string ("\\d")),
+ Fcons (Fcons (build_string ("TAB"), build_string ("\\t")),
+ Fcons (Fcons (build_string ("RET"), build_string ("\\r")),
+ Fcons (Fcons (build_string ("ESC"), build_string ("\\e")),
+ Fcons (Fcons (build_string ("SPC"), build_string (" ")),
+ Qnil)))));
+ staticpro (&exclude_keys);
+
DEFVAR_LISP ("define-key-rebound-commands", &Vdefine_key_rebound_commands,
doc: /* List of commands given new key bindings recently.
This is used for internal purposes during Emacs startup;
Qmenu_item = intern ("menu-item");
staticpro (&Qmenu_item);
+ Qremap = intern ("remap");
+ staticpro (&Qremap);
+
+ remap_command_vector = Fmake_vector (make_number (2), Qremap);
+ staticpro (&remap_command_vector);
+
where_is_cache_keymaps = Qt;
where_is_cache = Qnil;
staticpro (&where_is_cache);
defsubr (&Smake_keymap);
defsubr (&Smake_sparse_keymap);
defsubr (&Scopy_keymap);
+ defsubr (&Sremap_command);
defsubr (&Skey_binding);
defsubr (&Slocal_key_binding);
defsubr (&Sglobal_key_binding);