From: Stefan Monnier Date: Wed, 14 May 2003 18:35:09 +0000 (+0000) Subject: (make_lispy_event): Apply modifiers to multibyte chars. X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab57b16468d93ed813b327e3062a9ecc30116061;p=emacs.git (make_lispy_event): Apply modifiers to multibyte chars. --- diff --git a/src/ChangeLog b/src/ChangeLog index b3e10c0cb1b..ca57df34edb 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2003-05-14 Stefan Monnier + + * keyboard.c (make_lispy_event): Apply modifiers to multibyte chars. + 2003-05-03 Dave Love * config.in: Add HAVE_LIBLOCKFILE. @@ -34,8 +38,8 @@ 2003-02-23 Jan Dj,Ad(Brv * process.c (emacs_get_tty_pgrp): New function. - (Fprocess_running_child_p, process_send_signal): Call - emacs_get_tty_pgrp instead of ioctl. + (Fprocess_running_child_p, process_send_signal): + Call emacs_get_tty_pgrp instead of ioctl. (process_send_signal): Call EMACS_KILLPG if ioctl TIOCSIGSEND fails. 2003-02-19 Juanma Barranquero diff --git a/src/keyboard.c b/src/keyboard.c index 9d5e8ed4ac6..5ef5a3a31c5 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -1,5 +1,5 @@ /* Keyboard and mouse input; editor command loop. - Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000, 2001 + Copyright (C) 1985,86,87,88,89,93,94,95,96,97,99, 2000, 01, 2003 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -4662,8 +4662,16 @@ make_lispy_event (event) case multibyte_char_keystroke: { Lisp_Object lispy_c; + int c = event->code; - XSETFASTINT (lispy_c, event->code); + /* Add in the other modifier bits. We took care of ctrl_modifier + just above, and the shift key was taken care of by the X code, + and applied to control characters by make_ctrl_char. */ + c |= (event->modifiers + & (meta_modifier | alt_modifier + | hyper_modifier | super_modifier | ctrl_modifier)); + + XSETFASTINT (lispy_c, c); return lispy_c; } @@ -4681,21 +4689,6 @@ make_lispy_event (event) (sizeof (lispy_accent_keys) / sizeof (lispy_accent_keys[0]))); - /* Handle system-specific keysyms. */ - if (event->code & (1 << 28)) - { - /* We need to use an alist rather than a vector as the cache - since we can't make a vector long enuf. */ - if (NILP (current_kboard->system_key_syms)) - current_kboard->system_key_syms = Fcons (Qnil, Qnil); - return modify_event_symbol (event->code, - event->modifiers, - Qfunction_key, - current_kboard->Vsystem_key_alist, - 0, ¤t_kboard->system_key_syms, - (unsigned)-1); - } - #ifdef XK_kana_A if (event->code >= 0x400 && event->code < 0x500) return modify_event_symbol (event->code - 0x400, @@ -4715,14 +4708,33 @@ make_lispy_event (event) iso_lispy_function_keys, &func_key_syms, (sizeof (iso_lispy_function_keys) / sizeof (iso_lispy_function_keys[0]))); - else #endif - return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, - event->modifiers, - Qfunction_key, Qnil, - lispy_function_keys, &func_key_syms, - (sizeof (lispy_function_keys) - / sizeof (lispy_function_keys[0]))); + + /* Handle system-specific or unknown keysyms. */ + if (event->code & (1 << 28) + || event->code - FUNCTION_KEY_OFFSET < 0 + || (event->code - FUNCTION_KEY_OFFSET + >= sizeof lispy_function_keys / sizeof *lispy_function_keys) + || !lispy_function_keys[event->code - FUNCTION_KEY_OFFSET]) + { + /* We need to use an alist rather than a vector as the cache + since we can't make a vector long enuf. */ + if (NILP (current_kboard->system_key_syms)) + current_kboard->system_key_syms = Fcons (Qnil, Qnil); + return modify_event_symbol (event->code, + event->modifiers, + Qfunction_key, + current_kboard->Vsystem_key_alist, + 0, ¤t_kboard->system_key_syms, + (unsigned) -1); + } + + return modify_event_symbol (event->code - FUNCTION_KEY_OFFSET, + event->modifiers, + Qfunction_key, Qnil, + lispy_function_keys, &func_key_syms, + (sizeof (lispy_function_keys) + / sizeof (lispy_function_keys[0]))); #ifdef HAVE_MOUSE /* A mouse click. Figure out where it is, decide whether it's