diff options
| author | Richard M. Stallman | 1995-10-19 00:20:44 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-10-19 00:20:44 +0000 |
| commit | f9414d6226a5d8fc1152a0425641f15ef1677d6e (patch) | |
| tree | 6bd88ef02715660e1c4b362c80aed0c4c9e80cae /src | |
| parent | c2b714dee02bbd6e7b759a2a44ec0bc63ab2e84c (diff) | |
| download | emacs-f9414d6226a5d8fc1152a0425641f15ef1677d6e.tar.gz emacs-f9414d6226a5d8fc1152a0425641f15ef1677d6e.zip | |
(read_char): Let Vkeyboard_translate_table be char-table.
(syms_of_keyboard): Doc fix.
Diffstat (limited to 'src')
| -rw-r--r-- | src/keyboard.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/src/keyboard.c b/src/keyboard.c index 10e6a7842ad..cce87895707 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -2077,6 +2077,16 @@ read_char (commandflag, nmaps, maps, prev_event, used_mouse_menu) | |||
| 2077 | if (STRINGP (Vkeyboard_translate_table) | 2077 | if (STRINGP (Vkeyboard_translate_table) |
| 2078 | && XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c)) | 2078 | && XSTRING (Vkeyboard_translate_table)->size > XFASTINT (c)) |
| 2079 | XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]); | 2079 | XSETINT (c, XSTRING (Vkeyboard_translate_table)->data[XFASTINT (c)]); |
| 2080 | else if ((VECTORP (Vkeyboard_translate_table) | ||
| 2081 | && XVECTOR (Vkeyboard_translate_table)->size > XFASTINT (c)) | ||
| 2082 | || CHAR_TABLE_P (Vkeyboard_translate_table)) | ||
| 2083 | { | ||
| 2084 | Lisp_Object d; | ||
| 2085 | d = Faref (Vkeyboard_translate_table, c); | ||
| 2086 | /* nil in keyboard-translate-table means no translation. */ | ||
| 2087 | if (!NILP (d)) | ||
| 2088 | c = d; | ||
| 2089 | } | ||
| 2080 | } | 2090 | } |
| 2081 | 2091 | ||
| 2082 | /* If this event is a mouse click in the menu bar, | 2092 | /* If this event is a mouse click in the menu bar, |
| @@ -7370,9 +7380,12 @@ Useful to set before you dump a modified Emacs."); | |||
| 7370 | Vtop_level = Qnil; | 7380 | Vtop_level = Qnil; |
| 7371 | 7381 | ||
| 7372 | DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, | 7382 | DEFVAR_LISP ("keyboard-translate-table", &Vkeyboard_translate_table, |
| 7373 | "String used as translate table for keyboard input, or nil.\n\ | 7383 | "Translate table for keyboard input, or nil.\n\ |
| 7374 | Each character is looked up in this string and the contents used instead.\n\ | 7384 | Each character is looked up in this string and the contents used instead.\n\ |
| 7375 | If string is of length N, character codes N and up are untranslated."); | 7385 | The value may be a string, a vector, or a char-table.\n\ |
| 7386 | If it is a string or vector of length N,\n\ | ||
| 7387 | character codes N and up are untranslated.\n\ | ||
| 7388 | In a vector or a char-table, an element which is nil means \"no translation\"."); | ||
| 7376 | Vkeyboard_translate_table = Qnil; | 7389 | Vkeyboard_translate_table = Qnil; |
| 7377 | 7390 | ||
| 7378 | DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, | 7391 | DEFVAR_BOOL ("cannot-suspend", &cannot_suspend, |