97 |
/* Alist of elements like (DEL . "\d"). */ |
/* Alist of elements like (DEL . "\d"). */ |
98 |
static Lisp_Object exclude_keys; |
static Lisp_Object exclude_keys; |
99 |
|
|
100 |
/* Pre-allocated 2-element vector for Fremap_command to use. */ |
/* Pre-allocated 2-element vector for Fcommand_remapping to use. */ |
101 |
static Lisp_Object remap_command_vector; |
static Lisp_Object command_remapping_vector; |
102 |
|
|
103 |
/* A char with the CHAR_META bit set in a vector or the 0200 bit set |
/* A char with the CHAR_META bit set in a vector or the 0200 bit set |
104 |
in a string key sequence is equivalent to prefixing with this |
in a string key sequence is equivalent to prefixing with this |
1068 |
|
|
1069 |
/* This function may GC (it calls Fkey_binding). */ |
/* This function may GC (it calls Fkey_binding). */ |
1070 |
|
|
1071 |
DEFUN ("remap-command", Fremap_command, Sremap_command, 1, 1, 0, |
DEFUN ("command-remapping", Fcommand_remapping, Scommand_remapping, 1, 1, 0, |
1072 |
doc: /* Return the remapping for command COMMAND in current keymaps. |
doc: /* Return the remapping for command COMMAND in current keymaps. |
1073 |
Returns nil if COMMAND is not remapped (or not a symbol). */) |
Returns nil if COMMAND is not remapped (or not a symbol). */) |
1074 |
(command) |
(command) |
1077 |
if (!SYMBOLP (command)) |
if (!SYMBOLP (command)) |
1078 |
return Qnil; |
return Qnil; |
1079 |
|
|
1080 |
ASET (remap_command_vector, 1, command); |
ASET (command_remapping_vector, 1, command); |
1081 |
return Fkey_binding (remap_command_vector, Qnil, Qt); |
return Fkey_binding (command_remapping_vector, Qnil, Qt); |
1082 |
} |
} |
1083 |
|
|
1084 |
/* Value is number if KEY is too long; nil if valid but has no definition. */ |
/* Value is number if KEY is too long; nil if valid but has no definition. */ |
1490 |
if (NILP (no_remap) && SYMBOLP (value)) |
if (NILP (no_remap) && SYMBOLP (value)) |
1491 |
{ |
{ |
1492 |
Lisp_Object value1; |
Lisp_Object value1; |
1493 |
if (value1 = Fremap_command (value), !NILP (value1)) |
if (value1 = Fcommand_remapping (value), !NILP (value1)) |
1494 |
value = value1; |
value = value1; |
1495 |
} |
} |
1496 |
|
|
2257 |
if (NILP (no_remap) && SYMBOLP (definition)) |
if (NILP (no_remap) && SYMBOLP (definition)) |
2258 |
{ |
{ |
2259 |
Lisp_Object tem; |
Lisp_Object tem; |
2260 |
if (tem = Fremap_command (definition), !NILP (tem)) |
if (tem = Fcommand_remapping (definition), !NILP (tem)) |
2261 |
return Qnil; |
return Qnil; |
2262 |
} |
} |
2263 |
|
|
3644 |
Qremap = intern ("remap"); |
Qremap = intern ("remap"); |
3645 |
staticpro (&Qremap); |
staticpro (&Qremap); |
3646 |
|
|
3647 |
remap_command_vector = Fmake_vector (make_number (2), Qremap); |
command_remapping_vector = Fmake_vector (make_number (2), Qremap); |
3648 |
staticpro (&remap_command_vector); |
staticpro (&command_remapping_vector); |
3649 |
|
|
3650 |
where_is_cache_keymaps = Qt; |
where_is_cache_keymaps = Qt; |
3651 |
where_is_cache = Qnil; |
where_is_cache = Qnil; |
3659 |
defsubr (&Smake_keymap); |
defsubr (&Smake_keymap); |
3660 |
defsubr (&Smake_sparse_keymap); |
defsubr (&Smake_sparse_keymap); |
3661 |
defsubr (&Scopy_keymap); |
defsubr (&Scopy_keymap); |
3662 |
defsubr (&Sremap_command); |
defsubr (&Scommand_remapping); |
3663 |
defsubr (&Skey_binding); |
defsubr (&Skey_binding); |
3664 |
defsubr (&Slocal_key_binding); |
defsubr (&Slocal_key_binding); |
3665 |
defsubr (&Sglobal_key_binding); |
defsubr (&Sglobal_key_binding); |