diff --git a/src/cmds.c b/src/cmds.c index f7a3f9e7ac6..ba5cef9dd48 100644 --- a/src/cmds.c +++ b/src/cmds.c @@ -278,6 +278,8 @@ a non-nil value for the inserted character. At the end, it runs /* Backward compatibility. */ if (NILP (c)) c = last_command_event; + else + last_command_event = c; if (XFIXNUM (n) < 0) error ("Negative repetition argument %"pI"d", XFIXNUM (n)); @@ -288,14 +290,15 @@ a non-nil value for the inserted character. At the end, it runs /* Barf if the key that invoked this was not a character. */ if (!CHARACTERP (c)) bitch_at_user (); - else { - int character = translate_char (Vtranslation_table_for_input, - XFIXNUM (c)); - int val = internal_self_insert (character, XFIXNAT (n)); - if (val == 2) - Fset (Qundo_auto__this_command_amalgamating, Qnil); - frame_make_pointer_invisible (SELECTED_FRAME ()); - } + else + { + int character = translate_char (Vtranslation_table_for_input, + XFIXNUM (c)); + int val = internal_self_insert (character, XFIXNAT (n)); + if (val == 2) + Fset (Qundo_auto__this_command_amalgamating, Qnil); + frame_make_pointer_invisible (SELECTED_FRAME ()); + } return Qnil; }