From 120a451c040011925c3c736058f2ce040e04d5fc Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Mon, 26 Jan 2026 10:14:03 -0500 Subject: [PATCH] (read_char_minibuf_menu_prompt): Fix bug#80146 * src/keyboard.c (read_char_minibuf_menu_prompt): Give priority to a binding in the map over the `menu_prompt_more_char` "binding". (follow_key): Move before new first use. --- src/keyboard.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 0bf134961a3..bc36d899250 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -10118,6 +10118,13 @@ read_char_x_menu_prompt (Lisp_Object map, return Qnil ; } +static Lisp_Object +follow_key (Lisp_Object keymap, Lisp_Object key) +{ + return access_keymap (get_keymap (keymap, 0, 1), + key, 1, 0, 1); +} + static Lisp_Object read_char_minibuf_menu_prompt (int commandflag, Lisp_Object map) @@ -10329,7 +10336,10 @@ read_char_minibuf_menu_prompt (int commandflag, if (!FIXNUMP (obj) || XFIXNUM (obj) == -2 || (! EQ (obj, menu_prompt_more_char) && (!FIXNUMP (menu_prompt_more_char) - || ! BASE_EQ (obj, make_fixnum (Ctl (XFIXNUM (menu_prompt_more_char))))))) + || ! BASE_EQ (obj, make_fixnum (Ctl (XFIXNUM (menu_prompt_more_char)))))) + /* If 'menu_prompt_more_char' collides with a binding in the + map, gives precedence to the map's binding (bug#80146). */ + || !NILP (follow_key (map, obj))) { if (!NILP (KVAR (current_kboard, defining_kbd_macro))) store_kbd_macro_char (obj); @@ -10341,13 +10351,6 @@ read_char_minibuf_menu_prompt (int commandflag, /* Reading key sequences. */ -static Lisp_Object -follow_key (Lisp_Object keymap, Lisp_Object key) -{ - return access_keymap (get_keymap (keymap, 0, 1), - key, 1, 0, 1); -} - static Lisp_Object active_maps (Lisp_Object first_event, Lisp_Object second_event) {