From e83f6bb0746d9c18016e5eb31259b0fb3eba4d6c Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Wed, 6 Jan 1999 23:54:44 +0000 Subject: [PATCH] (read_key_sequence): Tell get_keyelt to look handle autoloads. Handle symbols defined as keymaps, and autoloaded keymaps. --- src/keyboard.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/keyboard.c b/src/keyboard.c index 7ba7f0a6319..a8a620a4e53 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -7509,10 +7509,21 @@ read_key_sequence (keybuf, bufsize, prompt, dont_downcase_last, keytran_next = keytran_map; keytran_next - = get_keyelt (access_keymap (keytran_next, key, 1, 0), 0); + = get_keyelt (access_keymap (keytran_next, key, 1, 0), 1); + if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next)) + && CONSP (XSYMBOL (keytran_next)->function) + && EQ (XCONS (XSYMBOL (keytran_next)->function)->car, Qautoload)) + do_autoload (XSYMBOL (keytran_next)->function, + keytran_next); + + /* Handle a symbol whose function definition is a keymap. */ + if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next)) + && !NILP (Fkeymapp (XSYMBOL (keytran_next)->function))) + keytran_next = XSYMBOL (keytran_next)->function; + /* If the key translation map gives a function, not an - array, then call the function with no args and use + array, then call the function with one arg and use its value instead. */ if (SYMBOLP (keytran_next) && ! NILP (Ffboundp (keytran_next)) && keytran_end == t) -- 2.39.2