emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-unicode-2 branch - src/macterm.c function mac_set_unicode_keystrok


From: CHENG Gao
Subject: emacs-unicode-2 branch - src/macterm.c function mac_set_unicode_keystroke_event - should it be reverted in cvs?
Date: Thu, 22 Nov 2007 00:43:15 +0800
User-agent: Gnus/5.110007 (No Gnus v0.7) Emacs/23.0.0 (darwin)

In src/macterm.c (emacs-unicode-2 branch), function
mac_set_unicode_keystroke_event is as below:

,----
| static void
| mac_set_unicode_keystroke_event (code, buf)
|      UniChar code;
|      struct input_event *buf;
| {
|   int charset_id, c1, c2;
| 
|   if (code < 0x80)
|     {
|       buf->kind = ASCII_KEYSTROKE_EVENT;
|       buf->code = code;
|     }
|   else if (code < 0x100)
|     {
|       if (code < 0xA0)
|       charset_id = CHARSET_8_BIT_CONTROL;
|       else
|       charset_id = charset_latin_iso8859_1;
|       buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
|       buf->code = MAKE_CHAR (charset_id, code, 0);
|     }
|   else
|     {
|       if (code < 0x2500)
|       charset_id = charset_mule_unicode_0100_24ff,
|         code -= 0x100;
|       else if (code < 0x33FF)
|       charset_id = charset_mule_unicode_2500_33ff,
|         code -= 0x2500;
|       else if (code >= 0xE000)
|       charset_id = charset_mule_unicode_e000_ffff,
|         code -= 0xE000;
|       c1 = (code / 96) + 32, c2 = (code % 96) + 32;
|       buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
|       buf->code = MAKE_CHAR (charset_id, c1, c2);
|     }
| }
`----

>From reading this group (gmane.emacs.devel) I got impression that this
function is mis-re-introduced and should be reverted to OLD version as
below:

,----
| static void
| mac_set_unicode_keystroke_event (code, buf)
|      UniChar code;
|      struct input_event *buf;
| {
|   int charset_id, c1, c2;
| 
|   if (code < 0x80)
|     buf->kind = ASCII_KEYSTROKE_EVENT;
|   else
|     buf->kind = MULTIBYTE_CHAR_KEYSTROKE_EVENT;
|   buf->code = code;
| }
`----

Is this correct? If so, could you please revert it in cvs.
Considering the situation that TRUNK is buildable and usable in MacOSX,
and emacs-unicode-2 is buildable (with this revert), it may be
meaningful even though Carbon port is *to some extent* deprecated and
declared unsupported. After all, Cocoa port (http://emacs-app.sf.net) is
not officially planned to merge, and Mac port is only one step away from
working.

-- 
Numquam minus solus quam cum solus






reply via email to

[Prev in Thread] Current Thread [Next in Thread]