APPROVE COMMIT
NOTE: This patch has been committed.
Markus Kuhn has a widely implemented, several-year-old, stable, draft
standard for mapping X11 keysyms to Unicode code points, when those code
points don’t already have an associated X11 keysym. It’s available at
http://www.cl.cam.ac.uk/~mgk25/ucs/X11.keysyms.pdf .
The below gives XEmacs support for these keysyms. Although the spec says the
mapping should only happen for Unicode code points above #x100, XFree86,
proud torchbearers of the X11 tradition, have shipped thousands of desktops
with Latin-1 characters encoded using these keysyms. As such, we start check
the X11 keysym code range from what would correspond to U+00A0 upwards until
U+10FFFF.
XEmacs Trunk source patch:
Diff command: cvs -q diff -u
Files affected: src/event-Xt.c lisp/startup.el
Index: lisp/startup.el
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/lisp/startup.el,v
retrieving revision 1.53
diff -u -u -r1.53 startup.el
--- lisp/startup.el 2005/01/26 04:56:18 1.53
+++ lisp/startup.el 2005/03/29 02:56:04
@@ -703,6 +703,11 @@
(when (featurep 'toolbar)
(init-toolbar-location))
+ ;; Setup coding systems and Unicode support--needs to be before X11
+ ;; initialisation in case of keysyms of the form UABCD.
+ (when (featurep 'mule)
+ (declare-fboundp (init-mule-at-startup)))
+
(if (featurep 'toolbar)
(if (featurep 'infodock)
(require 'id-x-toolbar)
@@ -736,10 +741,6 @@
;; In this case, I completely agree. --ben
(if (featurep 'menubar)
(init-menubar-at-startup))
- ;; perhaps this should go earlier in the process?
- (if (featurep 'mule)
- (declare-fboundp (init-mule-at-startup)))
-
;;
;; We have normality, I repeat, we have normality. Anything you still
;; can't cope with is therefore your own problem. (And we don't need
Index: src/event-Xt.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/event-Xt.c,v
retrieving revision 1.82
diff -u -u -r1.82 event-Xt.c
--- src/event-Xt.c 2005/01/24 23:33:52 1.82
+++ src/event-Xt.c 2005/03/29 02:56:07
@@ -71,6 +71,8 @@
extern int mswindows_is_blocking;
#endif
+EXFUN (Funicode_to_char, 2); /* In unicode.c. */
+
/* used in glyphs-x.c */
void enqueue_focus_event (Widget wants_it, Lisp_Object frame, int in_p);
static void handle_focus_event_1 (struct frame *f, int in_p);
@@ -200,6 +202,15 @@
if ((keysym & 0xff) < 0xa0)
return Qnil;
+
+ /* The spec says keysyms in the range #x01000100 to #x0110FFFF and
+ only those should correspond directly to Unicode code points, in
+ the range #x100-#x10FFFF; actual implementations can have the Latin
+ 1 code points do the same thing with keysyms
+ #x010000A0-#x01000100. Oops. */
+
+ if (keysym >= 0x010000A0 && keysym <= 0x0110FFFF)
+ return Funicode_to_char (make_int(keysym & 0xffffff), Qnil);
switch (keysym >> 8)
{
--
“I, for instance, am gung-ho about open source because my family is being
held hostage in Rob Malda’s basement. But who fact-checks me, or Enderle,
when we say something in public? No-one!” -- Danny O’Brien