From: Eli Zaretskii Date: Sat, 15 Jun 2024 08:08:22 +0000 (+0300) Subject: Fix electric-pair-mode when characters are bound to non-ASCII keys X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=faa5b83351e7a878df49ac58d5c795b0c13394d4;p=emacs.git Fix electric-pair-mode when characters are bound to non-ASCII keys * src/cmds.c (Fself_insert_command): Record the argument C in 'last-command-event'. (Bug#71337) (cherry picked from commit 988203fe980e3c80f736ad0b6aae9f288ebfa0f1) --- 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; }