From a04ee8ea10efd2fa9eb91100918115ad29fdc1ff Mon Sep 17 00:00:00 2001 From: Dave Love Date: Sun, 27 Oct 2002 21:13:06 +0000 Subject: [PATCH] (Vx_keysym_table): New. (syms_of_xterm): Initialize it. (XTread_socket): Use it. From head: Eliminate incorrect optimization that tried to avoid decoding the output of X*LookupString. (x_get_font_repertory): Delete charset declaration. --- lisp/ChangeLog | 9 +++++++++ src/xterm.c | 40 +++++++++++++++++++++++++--------------- 2 files changed, 34 insertions(+), 15 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 88fa20216a3..79e7079f43d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +2002-10-27 Dave Love + + * term/x-win.el: Remove some ancient compatibility code. Populate + x-keysym-table. + + * international/mule-cmds.el (wid-edit): Require when compiling. + (set-locale-environment): Check locale against coding system + aliases too. + 2002-10-25 Kenichi Handa * language/indian.el (in-is13194-devanagari): Fix diff --git a/src/xterm.c b/src/xterm.c index 07d14959f7f..2c9ae41764b 100644 --- a/src/xterm.c +++ b/src/xterm.c @@ -385,7 +385,7 @@ extern Lisp_Object Vcommand_line_args, Vsystem_name; extern Lisp_Object Vx_no_window_manager; -extern Lisp_Object Qface, Qmouse_face; +extern Lisp_Object Qface, Qmouse_face, Qeql; extern int errno; @@ -396,6 +396,7 @@ extern int extra_keyboard_modifiers; /* The keysyms to use for the various modifiers. */ Lisp_Object Vx_alt_keysym, Vx_hyper_keysym, Vx_meta_keysym, Vx_super_keysym; +Lisp_Object Vx_keysym_table; static Lisp_Object Qalt, Qhyper, Qmeta, Qsuper, Qmodifier_value; static Lisp_Object Qvendor_specific_keysyms; @@ -10641,11 +10642,25 @@ XTread_socket (sd, bufp, numchars, expected) #endif /* not HAVE_X11R5 */ )) { + Lisp_Object c; + if (temp_index == sizeof temp_buffer / sizeof (short)) temp_index = 0; temp_buffer[temp_index++] = keysym; - bufp->kind = non_ascii_keystroke; - bufp->code = keysym; + if (! EQ ((c = Fgethash (make_number (keysym), + Vx_keysym_table, Qnil)), + Qnil)) + { + bufp->kind = (ASCII_CHAR_P (c) + ? ascii_keystroke + : multibyte_char_keystroke); + bufp->code = c; + } + else + { + bufp->kind = non_ascii_keystroke; + bufp->code = keysym; + } XSETFRAME (bufp->frame_or_window, f); bufp->arg = Qnil; bufp->modifiers @@ -10670,18 +10685,8 @@ XTread_socket (sd, bufp, numchars, expected) temp_buffer[temp_index++] = copy_bufptr[i]; } - if (/* If the event is not from XIM, */ - event.xkey.keycode != 0 - /* or the current locale doesn't request - decoding of the input data, ... */ - || ! CODING_REQUIRE_DECODING (&coding)) - { - /* ... we can use the input data as is. */ - nchars = nbytes; - } - else { - /* We have to decode the input data. */ + /* Decode the input data. */ coding.destination = (unsigned char *) malloc (nbytes); if (! coding.destination) @@ -14490,7 +14495,6 @@ x_get_font_repertory (f, font_info) struct font_info *font_info; { XFontStruct *font = (XFontStruct *) font_info->font; - struct charset *charset = CHARSET_FROM_ID (font_info->charset); Lisp_Object table; int min_byte1, max_byte1, min_byte2, max_byte2; @@ -15295,6 +15299,12 @@ For example, `super' means use the Super_L and Super_R keysyms. The default is nil, which is the same as `super'. */); Vx_super_keysym = Qnil; + DEFVAR_LISP ("x-keysym-table", &Vx_keysym_table, + doc: /* Hash table of character codes indexed by X keysym codes. */); + Vx_keysym_table = make_hash_table (Qeql, make_number (800), + make_number (DEFAULT_REHASH_SIZE), + make_number (DEFAULT_REHASH_THRESHOLD), + Qnil, Qnil, Qnil); } #endif /* HAVE_X_WINDOWS */ -- 2.11.4.GIT