# HG changeset patch # User Richard M. Stallman # Date 814062044 0 # Node ID 47725e106652b0bef397a0a1822460136b97279f # Parent 2e0c4159e94bc8c8cbff75dc5837dffeada03956 (read_char): Let Vkeyboard_translate_table be char-table. (syms_of_keyboard): Doc fix. diff -r 2e0c4159e94b -r 47725e106652 src/keyboard.c --- a/src/keyboard.c Thu Oct 19 00:17:11 1995 +0000 +++ b/src/keyboard.c Thu Oct 19 00:20:44 1995 +0000 @@ -2077,6 +2077,16 @@ if (STRINGP (Vkeyboard_translate_table) && XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c)) XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]); + else if ((VECTORP (Vkeyboard_translate_table) + && XVECTOR (Vkeyboard_translate_table)->size > XFASTINT (c)) + || CHAR_TABLE_P (Vkeyboard_translate_table)) + { + Lisp_Object d; + d = Faref (Vkeyboard_translate_table, c); + /* nil in keyboard-translate-table means no translation. */ + if (!NILP (d)) + c = d; + } } /* If this event is a mouse click in the menu bar, @@ -7370,9 +7380,12 @@ Vtop_level = Qnil; DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, - "String used as translate table for keyboard input, or nil.\n\ + "Translate table for keyboard input, or nil.\n\ Each character is looked up in this string and the contents used instead.\n\ -If string is of length N, character codes N and up are untranslated."); +The value may be a string, a vector, or a char-table.\n\ +If it is a string or vector of length N,\n\ +character codes N and up are untranslated.\n\ +In a vector or a char-table, an element which is nil means \"no translation\"."); Vkeyboard_translate_table = Qnil; DEFVAR_BOOL ("cannot-suspend", &cannot_suspend,