From faa5b83351e7a878df49ac58d5c795b0c13394d4 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 15 Jun 2024 11:08:22 +0300 Subject: [PATCH] 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) --- src/cmds.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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; } -- 2.39.2