Function: command-remapping

command-remapping is a function defined in keymap.c.

Signature

(command-remapping COMMAND &optional POSITION KEYMAPS)

Documentation

Return the remapping for command COMMAND.

Returns nil if COMMAND is not remapped (or not a symbol).

If the optional argument POSITION is non-nil, it specifies a mouse position as returned by event-start and event-end, and the remapping occurs in the keymaps associated with it. It can also be a number or marker, in which case the keymap properties at the specified buffer position instead of point are used. The KEYMAPS argument is ignored if POSITION is non-nil.

If the optional argument KEYMAPS is non-nil, it should be a keymap or list of keymaps to search for command remapping. Otherwise, search for the remapping in all currently active keymaps.

View in manual

Probably introduced at or before Emacs version 22.1.

Source Code

// Defined in /usr/src/emacs/src/keymap.c
{
  if (!SYMBOLP (command))
    return Qnil;

  ASET (command_remapping_vector, 1, command);

  if (NILP (keymaps))
    command = Fkey_binding (command_remapping_vector, Qnil, Qt, position);
  else
    command = Flookup_key (keymaps, command_remapping_vector, Qnil);
  return FIXNUMP (command) ? Qnil : command;
}