Index: gtk/gtkimcontextsimple.c
===================================================================
--- gtk/gtkimcontextsimple.c	(revision 18537)
+++ gtk/gtkimcontextsimple.c	(working copy)
@@ -64,63 +64,13 @@
   GDK_Greek_accentdieresis,	GDK_Greek_iota,	0,	0,	0,	0x0390,	/* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
   GDK_Greek_accentdieresis,	GDK_Greek_upsilon,	0,	0,	0,	0x03B0,	/* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
   GDK_dead_grave,	GDK_space,	0,	0,	0,	0x0060,	/* GRAVE_ACCENT */
-  GDK_dead_grave,	GDK_A,	0,	0,	0,	0x00C0,	/* LATIN_CAPITAL_LETTER_A_WITH_GRAVE */
-  GDK_dead_grave,	GDK_E,	0,	0,	0,	0x00C8,	/* LATIN_CAPITAL_LETTER_E_WITH_GRAVE */
-  GDK_dead_grave,	GDK_I,	0,	0,	0,	0x00CC,	/* LATIN_CAPITAL_LETTER_I_WITH_GRAVE */
-  GDK_dead_grave,	GDK_O,	0,	0,	0,	0x00D2,	/* LATIN_CAPITAL_LETTER_O_WITH_GRAVE */
-  GDK_dead_grave,	GDK_U,	0,	0,	0,	0x00D9,	/* LATIN_CAPITAL_LETTER_U_WITH_GRAVE */
   GDK_dead_grave,       GDK_grave,      0,      0,      0,      0x0060, /* GRAVE_ACCENT */
-  GDK_dead_grave,	GDK_a,	0,	0,	0,	0x00E0,	/* LATIN_SMALL_LETTER_A_WITH_GRAVE */
-  GDK_dead_grave,	GDK_e,	0,	0,	0,	0x00E8,	/* LATIN_SMALL_LETTER_E_WITH_GRAVE */
-  GDK_dead_grave,	GDK_i,	0,	0,	0,	0x00EC,	/* LATIN_SMALL_LETTER_I_WITH_GRAVE */
-  GDK_dead_grave,	GDK_o,	0,	0,	0,	0x00F2,	/* LATIN_SMALL_LETTER_O_WITH_GRAVE */
-  GDK_dead_grave,	GDK_u,	0,	0,	0,	0x00F9,	/* LATIN_SMALL_LETTER_U_WITH_GRAVE */
   GDK_dead_grave,       GDK_dead_grave, 0,      0,      0,      0x0060, /* GRAVE_ACCENT */  
   GDK_dead_acute,	GDK_space,	0,	0,	0,	0x0027,	/* APOSTROPHE */
   GDK_dead_acute,	GDK_apostrophe,	0,	0,	0,	0x00B4,	/* ACUTE_ACCENT */
-  GDK_dead_acute,	GDK_A,	0,	0,	0,	0x00C1,	/* LATIN_CAPITAL_LETTER_A_WITH_ACUTE */
-  GDK_dead_acute,	GDK_C,	0,	0,	0,	0x0106,	/* LATIN_CAPITAL_LETTER_C_WITH_ACUTE */
-  GDK_dead_acute,	GDK_E,	0,	0,	0,	0x00C9,	/* LATIN_CAPITAL_LETTER_E_WITH_ACUTE */
-  GDK_dead_acute,	GDK_I,	0,	0,	0,	0x00CD,	/* LATIN_CAPITAL_LETTER_I_WITH_ACUTE */
-  GDK_dead_acute,	GDK_L,	0,	0,	0,	0x0139,	/* LATIN_CAPITAL_LETTER_L_WITH_ACUTE */
-  GDK_dead_acute,	GDK_N,	0,	0,	0,	0x0143,	/* LATIN_CAPITAL_LETTER_N_WITH_ACUTE */
-  GDK_dead_acute,	GDK_O,	0,	0,	0,	0x00D3,	/* LATIN_CAPITAL_LETTER_O_WITH_ACUTE */
-  GDK_dead_acute,	GDK_R,	0,	0,	0,	0x0154,	/* LATIN_CAPITAL_LETTER_R_WITH_ACUTE */
-  GDK_dead_acute,	GDK_S,	0,	0,	0,	0x015A,	/* LATIN_CAPITAL_LETTER_S_WITH_ACUTE */
-  GDK_dead_acute,	GDK_U,	0,	0,	0,	0x00DA,	/* LATIN_CAPITAL_LETTER_U_WITH_ACUTE */
-  GDK_dead_acute,	GDK_Y,	0,	0,	0,	0x00DD,	/* LATIN_CAPITAL_LETTER_Y_WITH_ACUTE */
-  GDK_dead_acute,	GDK_Z,	0,	0,	0,	0x0179,	/* LATIN_CAPITAL_LETTER_Z_WITH_ACUTE */
-  GDK_dead_acute,	GDK_a,	0,	0,	0,	0x00E1,	/* LATIN_SMALL_LETTER_A_WITH_ACUTE */
-  GDK_dead_acute,	GDK_c,	0,	0,	0,	0x0107,	/* LATIN_SMALL_LETTER_C_WITH_ACUTE */
-  GDK_dead_acute,	GDK_e,	0,	0,	0,	0x00E9,	/* LATIN_SMALL_LETTER_E_WITH_ACUTE */
-  GDK_dead_acute,	GDK_i,	0,	0,	0,	0x00ED,	/* LATIN_SMALL_LETTER_I_WITH_ACUTE */
-  GDK_dead_acute,	GDK_l,	0,	0,	0,	0x013A,	/* LATIN_SMALL_LETTER_L_WITH_ACUTE */
-  GDK_dead_acute,	GDK_n,	0,	0,	0,	0x0144,	/* LATIN_SMALL_LETTER_N_WITH_ACUTE */
-  GDK_dead_acute,	GDK_o,	0,	0,	0,	0x00F3,	/* LATIN_SMALL_LETTER_O_WITH_ACUTE */
-  GDK_dead_acute,	GDK_r,	0,	0,	0,	0x0155,	/* LATIN_SMALL_LETTER_R_WITH_ACUTE */
-  GDK_dead_acute,	GDK_s,	0,	0,	0,	0x015B,	/* LATIN_SMALL_LETTER_S_WITH_ACUTE */
-  GDK_dead_acute,	GDK_u,	0,	0,	0,	0x00FA,	/* LATIN_SMALL_LETTER_U_WITH_ACUTE */
-  GDK_dead_acute,	GDK_y,	0,	0,	0,	0x00FD,	/* LATIN_SMALL_LETTER_Y_WITH_ACUTE */
-  GDK_dead_acute,	GDK_z,	0,	0,	0,	0x017A,	/* LATIN_SMALL_LETTER_Z_WITH_ACUTE */
   GDK_dead_acute,	GDK_acute,	0,	0,	0,	0x00B4,	/* ACUTE_ACCENT */
-  GDK_dead_acute,	GDK_Greek_ALPHA,	0,	0,	0,	0x0386,	/* GREEK CAPITAL LETTER ALPHA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_EPSILON,	0,	0,	0,	0x0388,	/* GREEK CAPITAL LETTER EPSILON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_ETA,	0,	0,	0,	0x0389,	/* GREEK CAPITAL LETTER ETA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_IOTA,	0,	0,	0,	0x038A,	/* GREEK CAPITAL LETTER IOTA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_OMICRON,	0,	0,	0,	0x038C,	/* GREEK CAPITAL LETTER OMICRON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_UPSILON,	0,	0,	0,	0x038E,	/* GREEK CAPITAL LETTER UPSILON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_OMEGA,	0,	0,	0,	0x038F,	/* GREEK CAPITAL LETTER OMEGA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_alpha,	0,	0,	0,	0x03AC,	/* GREEK SMALL LETTER ALPHA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_epsilon,	0,	0,	0,	0x03AD,	/* GREEK SMALL LETTER EPSILON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_eta,	0,	0,	0,	0x03AE,	/* GREEK SMALL LETTER ETA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_iota,	0,	0,	0,	0x03AF,	/* GREEK SMALL LETTER IOTA WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_omicron,	0,	0,	0,	0x03CC,	/* GREEK SMALL LETTER OMICRON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_upsilon,	0,	0,	0,	0x03CD,	/* GREEK SMALL LETTER UPSILON WITH TONOS */
-  GDK_dead_acute,	GDK_Greek_omega,	0,	0,	0,	0x03CE,	/* GREEK SMALL LETTER OMEGA WITH TONOS */
   GDK_dead_acute,	GDK_dead_acute,	0,	0,	0,	0x00B4,	/* ACUTE_ACCENT */
   GDK_dead_acute,	GDK_dead_diaeresis,	GDK_space,	0,	0,	0x0385,	/* GREEK DIALYTIKA TONOS */
-  GDK_dead_acute,	GDK_dead_diaeresis,	GDK_Greek_iota,	0,	0,	0x0390,	/* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
-  GDK_dead_acute,	GDK_dead_diaeresis,	GDK_Greek_upsilon,	0,	0,	0x03B0,	/* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
   GDK_dead_circumflex,	GDK_space,	0,	0,	0,	0x005E,	/* CIRCUMFLEX_ACCENT */
   GDK_dead_circumflex,	GDK_minus,	0,	0,	0,	0x00AF,	/* MACRON */
   GDK_dead_circumflex,	GDK_period,	0,	0,	0,	0x00B7,	/* MIDDLE_DOT */
@@ -129,143 +79,38 @@
   GDK_dead_circumflex,	GDK_1,	0,	0,	0,	0x00B9,	/* SUPERSCRIPT_ONE */
   GDK_dead_circumflex,	GDK_2,	0,	0,	0,	0x00B2,	/* SUPERSCRIPT_TWO */
   GDK_dead_circumflex,	GDK_3,	0,	0,	0,	0x00B3,	/* SUPERSCRIPT_THREE */
-  GDK_dead_circumflex,	GDK_A,	0,	0,	0,	0x00C2,	/* LATIN_CAPITAL_LETTER_A_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_E,	0,	0,	0,	0x00CA,	/* LATIN_CAPITAL_LETTER_E_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_I,	0,	0,	0,	0x00CE,	/* LATIN_CAPITAL_LETTER_I_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_O,	0,	0,	0,	0x00D4,	/* LATIN_CAPITAL_LETTER_O_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_U,	0,	0,	0,	0x00DB,	/* LATIN_CAPITAL_LETTER_U_WITH_CIRCUMFLEX */
   GDK_dead_circumflex,	GDK_asciicircum,	0,	0,	0,	0x005E,	/* CIRCUMFLEX_ACCENT */
   GDK_dead_circumflex,	GDK_underscore,	0,	0,	0,	0x00AF,	/* MACRON */
-  GDK_dead_circumflex,	GDK_a,	0,	0,	0,	0x00E2,	/* LATIN_SMALL_LETTER_A_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_e,	0,	0,	0,	0x00EA,	/* LATIN_SMALL_LETTER_E_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_i,	0,	0,	0,	0x00EE,	/* LATIN_SMALL_LETTER_I_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_o,	0,	0,	0,	0x00F4,	/* LATIN_SMALL_LETTER_O_WITH_CIRCUMFLEX */
-  GDK_dead_circumflex,	GDK_u,	0,	0,	0,	0x00FB,	/* LATIN_SMALL_LETTER_U_WITH_CIRCUMFLEX */
   GDK_dead_circumflex,	GDK_dead_circumflex,	0,	0,	0,	0x005E,	/* CIRCUMFLEX_ACCENT */
   GDK_dead_tilde,	GDK_space,	0,	0,	0,	0x007E,	/* TILDE */
-  GDK_dead_tilde,	GDK_A,	0,	0,	0,	0x00C3,	/* LATIN_CAPITAL_LETTER_A_WITH_TILDE */
-  GDK_dead_tilde,	GDK_I,	0,	0,	0,	0x0128,	/* LATIN_CAPITAL_LETTER_I_WITH_TILDE */
-  GDK_dead_tilde,	GDK_N,	0,	0,	0,	0x00D1,	/* LATIN_CAPITAL_LETTER_N_WITH_TILDE */
-  GDK_dead_tilde,	GDK_O,	0,	0,	0,	0x00D5,	/* LATIN_CAPITAL_LETTER_O_WITH_TILDE */
-  GDK_dead_tilde,	GDK_U,	0,	0,	0,	0x0168,	/* LATIN_CAPITAL_LETTER_U_WITH_TILDE */
-  GDK_dead_tilde,	GDK_a,	0,	0,	0,	0x00E3,	/* LATIN_SMALL_LETTER_A_WITH_TILDE */
-  GDK_dead_tilde,	GDK_i,	0,	0,	0,	0x0129,	/* LATIN_SMALL_LETTER_I_WITH_TILDE */
-  GDK_dead_tilde,	GDK_n,	0,	0,	0,	0x00F1,	/* LATIN_SMALL_LETTER_N_WITH_TILDE */
-  GDK_dead_tilde,	GDK_o,	0,	0,	0,	0x00F5,	/* LATIN_SMALL_LETTER_O_WITH_TILDE */
-  GDK_dead_tilde,	GDK_u,	0,	0,	0,	0x0169,	/* LATIN_SMALL_LETTER_U_WITH_TILDE */
   GDK_dead_tilde,	GDK_asciitilde,	0,	0,	0,	0x007E,	/* TILDE */
   GDK_dead_tilde,	GDK_dead_tilde,	0,	0,	0,	0x007E,	/* TILDE */
-  GDK_dead_macron,	GDK_A,	0,	0,	0,	0x0100,	/* LATIN_CAPITAL_LETTER_A_WITH_MACRON */
-  GDK_dead_macron,	GDK_E,	0,	0,	0,	0x0112,	/* LATIN_CAPITAL_LETTER_E_WITH_MACRON */
-  GDK_dead_macron,	GDK_I,	0,	0,	0,	0x012A,	/* LATIN_CAPITAL_LETTER_I_WITH_MACRON */
-  GDK_dead_macron,	GDK_O,	0,	0,	0,	0x014C,	/* LATIN_CAPITAL_LETTER_O_WITH_MACRON */
-  GDK_dead_macron,	GDK_U,	0,	0,	0,	0x016A,	/* LATIN_CAPITAL_LETTER_U_WITH_MACRON */
-  GDK_dead_macron,	GDK_a,	0,	0,	0,	0x0101,	/* LATIN_SMALL_LETTER_A_WITH_MACRON */
-  GDK_dead_macron,	GDK_e,	0,	0,	0,	0x0113,	/* LATIN_SMALL_LETTER_E_WITH_MACRON */
-  GDK_dead_macron,	GDK_i,	0,	0,	0,	0x012B,	/* LATIN_SMALL_LETTER_I_WITH_MACRON */
-  GDK_dead_macron,	GDK_o,	0,	0,	0,	0x014D,	/* LATIN_SMALL_LETTER_O_WITH_MACRON */
-  GDK_dead_macron,	GDK_u,	0,	0,	0,	0x016B,	/* LATIN_SMALL_LETTER_U_WITH_MACRON */
   GDK_dead_macron,	GDK_macron,	0,	0,	0,	0x00AF,	/* MACRON */
   GDK_dead_macron,	GDK_dead_macron,	0,	0,	0,	0x00AF,	/* MACRON */
   GDK_dead_breve,	GDK_space,	0,	0,	0,	0x02D8,	/* BREVE */
-  GDK_dead_breve,	GDK_A,	0,	0,	0,	0x0102,	/* LATIN_CAPITAL_LETTER_A_WITH_BREVE */
-  GDK_dead_breve,	GDK_G,	0,	0,	0,	0x011E,	/* LATIN_CAPITAL_LETTER_G_WITH_BREVE */
-  GDK_dead_breve,	GDK_a,	0,	0,	0,	0x0103,	/* LATIN_SMALL_LETTER_A_WITH_BREVE */
-  GDK_dead_breve,	GDK_g,	0,	0,	0,	0x011F,	/* LATIN_SMALL_LETTER_G_WITH_BREVE */
   GDK_dead_breve,	GDK_dead_breve,	0,	0,	0,	0x02D8,	/* BREVE */
   GDK_dead_abovedot,	GDK_space,	0,	0,	0,	0x02D9,	/* DOT_ABOVE */
-  GDK_dead_abovedot,	GDK_E,	0,	0,	0,	0x0116,	/* LATIN_CAPITAL_LETTER_E_WITH_DOT_ABOVE */
-  GDK_dead_abovedot,	GDK_I,	0,	0,	0,	0x0130,	/* LATIN_CAPITAL_LETTER_I_WITH_DOT_ABOVE */
-  GDK_dead_abovedot,	GDK_Z,	0,	0,	0,	0x017B,	/* LATIN_CAPITAL_LETTER_Z_WITH_DOT_ABOVE */
-  GDK_dead_abovedot,	GDK_e,	0,	0,	0,	0x0117,	/* LATIN_SMALL_LETTER_E_WITH_DOT_ABOVE */
   GDK_dead_abovedot,	GDK_i,	0,	0,	0,	0x0131,	/* LATIN_SMALL_LETTER_DOTLESS_I */
-  GDK_dead_abovedot,	GDK_z,	0,	0,	0,	0x017C,	/* LATIN_SMALL_LETTER_Z_WITH_DOT_ABOVE */
   GDK_dead_abovedot,	GDK_abovedot,	0,	0,	0,	0x02D9,	/* DOT_ABOVE */
   GDK_dead_abovedot,	GDK_dead_abovedot,	0,	0,	0,	0x02D9,	/* DOT_ABOVE */
   GDK_dead_diaeresis,	GDK_space,	0,	0,	0,	0x0022,	/* QUOTATION_MARK */
   GDK_dead_diaeresis,	GDK_quotedbl,	0,	0,	0,	0x00A8,	/* DIAERESIS */
-  GDK_dead_diaeresis,	GDK_A,	0,	0,	0,	0x00C4,	/* LATIN_CAPITAL_LETTER_A_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_E,	0,	0,	0,	0x00CB,	/* LATIN_CAPITAL_LETTER_E_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_I,	0,	0,	0,	0x00CF,	/* LATIN_CAPITAL_LETTER_I_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_O,	0,	0,	0,	0x00D6,	/* LATIN_CAPITAL_LETTER_O_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_U,	0,	0,	0,	0x00DC,	/* LATIN_CAPITAL_LETTER_U_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_Y,	0,	0,	0,	0x0178,	/* LATIN_CAPITAL_LETTER_Y_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_a,	0,	0,	0,	0x00E4,	/* LATIN_SMALL_LETTER_A_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_e,	0,	0,	0,	0x00EB,	/* LATIN_SMALL_LETTER_E_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_i,	0,	0,	0,	0x00EF,	/* LATIN_SMALL_LETTER_I_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_o,	0,	0,	0,	0x00F6,	/* LATIN_SMALL_LETTER_O_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_u,	0,	0,	0,	0x00FC,	/* LATIN_SMALL_LETTER_U_WITH_DIAERESIS */
-  GDK_dead_diaeresis,	GDK_y,	0,	0,	0,	0x00FF,	/* LATIN_SMALL_LETTER_Y_WITH_DIAERESIS */
   GDK_dead_diaeresis,	GDK_diaeresis,	0,	0,	0,	0x00A8,	/* DIAERESIS */
-  GDK_dead_diaeresis,	GDK_Greek_IOTA,	0,	0,	0,	0x03AA,	/* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */
-  GDK_dead_diaeresis,	GDK_Greek_UPSILON,	0,	0,	0,	0x03AB,	/* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */
-  GDK_dead_diaeresis,	GDK_Greek_iota,	0,	0,	0,	0x03CA,	/* GREEK SMALL LETTER IOTA WITH DIALYTIKA */
-  GDK_dead_diaeresis,	GDK_Greek_upsilon,	0,	0,	0,	0x03CB,	/* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */
   GDK_dead_diaeresis,	GDK_dead_acute,	GDK_space,	0,	0,	0x0385,	/* GREEK DIALYTIKA TONOS */
-  GDK_dead_diaeresis,	GDK_dead_acute,	GDK_Greek_iota,	0,	0,	0x0390,	/* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
-  GDK_dead_diaeresis,	GDK_dead_acute,	GDK_Greek_upsilon,	0,	0,	0x03B0,	/* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
   GDK_dead_diaeresis,	GDK_dead_diaeresis,	0,	0,	0,	0x00A8,	/* DIAERESIS */
   GDK_dead_abovering,	GDK_space,	0,	0,	0,	0x02DA,	/* RING_ABOVE */
-  GDK_dead_abovering,	GDK_A,	0,	0,	0,	0x00C5,	/* LATIN_CAPITAL_LETTER_A_WITH_RING_ABOVE */
-  GDK_dead_abovering,	GDK_U,	0,	0,	0,	0x016E,	/* LATIN_CAPITAL_LETTER_U_WITH_RING_ABOVE */
-  GDK_dead_abovering,	GDK_a,	0,	0,	0,	0x00E5,	/* LATIN_SMALL_LETTER_A_WITH_RING_ABOVE */
-  GDK_dead_abovering,	GDK_u,	0,	0,	0,	0x016F,	/* LATIN_SMALL_LETTER_U_WITH_RING_ABOVE */
   GDK_dead_abovering,	GDK_dead_abovering,	0,	0,	0,	0x02DA,	/* RING_ABOVE */
   GDK_dead_doubleacute,	GDK_space,	0,	0,	0,	0x02DD,	/* DOUBLE_ACUTE_ACCENT */
-  GDK_dead_doubleacute,	GDK_O,	0,	0,	0,	0x0150,	/* LATIN_CAPITAL_LETTER_O_WITH_DOUBLE_ACUTE */
-  GDK_dead_doubleacute,	GDK_U,	0,	0,	0,	0x0170,	/* LATIN_CAPITAL_LETTER_U_WITH_DOUBLE_ACUTE */
-  GDK_dead_doubleacute,	GDK_o,	0,	0,	0,	0x0151,	/* LATIN_SMALL_LETTER_O_WITH_DOUBLE_ACUTE */
-  GDK_dead_doubleacute,	GDK_u,	0,	0,	0,	0x0171,	/* LATIN_SMALL_LETTER_U_WITH_DOUBLE_ACUTE */
   GDK_dead_doubleacute,	GDK_dead_doubleacute,	0,	0,	0,	0x02DD,	/* DOUBLE_ACUTE_ACCENT */
   GDK_dead_caron,	GDK_space,	0,	0,	0,	0x02C7,	/* CARON */
-  GDK_dead_caron,	GDK_C,	0,	0,	0,	0x010C,	/* LATIN_CAPITAL_LETTER_C_WITH_CARON */
-  GDK_dead_caron,	GDK_D,	0,	0,	0,	0x010E,	/* LATIN_CAPITAL_LETTER_D_WITH_CARON */
-  GDK_dead_caron,	GDK_E,	0,	0,	0,	0x011A,	/* LATIN_CAPITAL_LETTER_E_WITH_CARON */
-  GDK_dead_caron,	GDK_L,	0,	0,	0,	0x013D,	/* LATIN_CAPITAL_LETTER_L_WITH_CARON */
-  GDK_dead_caron,	GDK_N,	0,	0,	0,	0x0147,	/* LATIN_CAPITAL_LETTER_N_WITH_CARON */
-  GDK_dead_caron,	GDK_R,	0,	0,	0,	0x0158,	/* LATIN_CAPITAL_LETTER_R_WITH_CARON */
-  GDK_dead_caron,	GDK_S,	0,	0,	0,	0x0160,	/* LATIN_CAPITAL_LETTER_S_WITH_CARON */
-  GDK_dead_caron,	GDK_T,	0,	0,	0,	0x0164,	/* LATIN_CAPITAL_LETTER_T_WITH_CARON */
-  GDK_dead_caron,	GDK_Z,	0,	0,	0,	0x017D,	/* LATIN_CAPITAL_LETTER_Z_WITH_CARON */
-  GDK_dead_caron,	GDK_c,	0,	0,	0,	0x010D,	/* LATIN_SMALL_LETTER_C_WITH_CARON */
-  GDK_dead_caron,	GDK_d,	0,	0,	0,	0x010F,	/* LATIN_SMALL_LETTER_D_WITH_CARON */
-  GDK_dead_caron,	GDK_e,	0,	0,	0,	0x011B,	/* LATIN_SMALL_LETTER_E_WITH_CARON */
-  GDK_dead_caron,	GDK_l,	0,	0,	0,	0x013E,	/* LATIN_SMALL_LETTER_L_WITH_CARON */
-  GDK_dead_caron,	GDK_n,	0,	0,	0,	0x0148,	/* LATIN_SMALL_LETTER_N_WITH_CARON */
-  GDK_dead_caron,	GDK_r,	0,	0,	0,	0x0159,	/* LATIN_SMALL_LETTER_R_WITH_CARON */
-  GDK_dead_caron,	GDK_s,	0,	0,	0,	0x0161,	/* LATIN_SMALL_LETTER_S_WITH_CARON */
-  GDK_dead_caron,	GDK_t,	0,	0,	0,	0x0165,	/* LATIN_SMALL_LETTER_T_WITH_CARON */
-  GDK_dead_caron,	GDK_z,	0,	0,	0,	0x017E,	/* LATIN_SMALL_LETTER_Z_WITH_CARON */
   GDK_dead_caron,	GDK_caron,	0,	0,	0,	0x02C7,	/* CARON */
   GDK_dead_caron,	GDK_dead_caron,	0,	0,	0,	0x02C7,	/* CARON */
   GDK_dead_cedilla,	GDK_space,	0,	0,	0,	0x00B8,	/* CEDILLA */
   GDK_dead_cedilla,	GDK_comma,	0,	0,	0,	0x00B8,	/* CEDILLA */
   GDK_dead_cedilla,	GDK_minus,	0,	0,	0,	0x00AC,	/* NOT_SIGN */
-  GDK_dead_cedilla,	GDK_C,	0,	0,	0,	0x00C7,	/* LATIN_CAPITAL_LETTER_C_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_G,	0,	0,	0,	0x0122,	/* LATIN_CAPITAL_LETTER_G_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_K,	0,	0,	0,	0x0136,	/* LATIN_CAPITAL_LETTER_K_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_L,	0,	0,	0,	0x013B,	/* LATIN_CAPITAL_LETTER_L_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_N,	0,	0,	0,	0x0145,	/* LATIN_CAPITAL_LETTER_N_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_R,	0,	0,	0,	0x0156,	/* LATIN_CAPITAL_LETTER_R_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_S,	0,	0,	0,	0x015E,	/* LATIN_CAPITAL_LETTER_S_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_c,	0,	0,	0,	0x00E7,	/* LATIN_SMALL_LETTER_C_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_g,	0,	0,	0,	0x0123,	/* LATIN_SMALL_LETTER_G_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_k,	0,	0,	0,	0x0137,	/* LATIN_SMALL_LETTER_K_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_l,	0,	0,	0,	0x013C,	/* LATIN_SMALL_LETTER_L_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_n,	0,	0,	0,	0x0146,	/* LATIN_SMALL_LETTER_N_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_r,	0,	0,	0,	0x0157,	/* LATIN_SMALL_LETTER_R_WITH_CEDILLA */
-  GDK_dead_cedilla,	GDK_s,	0,	0,	0,	0x015F,	/* LATIN_SMALL_LETTER_S_WITH_CEDILLA */
   GDK_dead_cedilla,	GDK_cedilla,	0,	0,	0,	0x00B8,	/* CEDILLA */
   GDK_dead_cedilla,	GDK_dead_cedilla,	0,	0,	0,	0x00B8,	/* CEDILLA */
   GDK_dead_ogonek,	GDK_space,	0,	0,	0,	0x02DB,	/* OGONEK */
-  GDK_dead_ogonek,	GDK_A,	0,	0,	0,	0x0104,	/* LATIN_CAPITAL_LETTER_A_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_E,	0,	0,	0,	0x0118,	/* LATIN_CAPITAL_LETTER_E_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_I,	0,	0,	0,	0x012E,	/* LATIN_CAPITAL_LETTER_I_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_U,	0,	0,	0,	0x0172,	/* LATIN_CAPITAL_LETTER_U_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_a,	0,	0,	0,	0x0105,	/* LATIN_SMALL_LETTER_A_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_e,	0,	0,	0,	0x0119,	/* LATIN_SMALL_LETTER_E_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_i,	0,	0,	0,	0x012F,	/* LATIN_SMALL_LETTER_I_WITH_OGONEK */
-  GDK_dead_ogonek,	GDK_u,	0,	0,	0,	0x0173,	/* LATIN_SMALL_LETTER_U_WITH_OGONEK */
   GDK_dead_ogonek,	GDK_ogonek,	0,	0,	0,	0x02DB,	/* OGONEK */
   GDK_dead_ogonek,	GDK_dead_ogonek,	0,	0,	0,	0x02DB,	/* OGONEK */
   GDK_Multi_key,	GDK_space,	GDK_space,	0,	0,	0x00A0,	/* NOxBREAK_SPACE */
@@ -1044,13 +889,18 @@
 {
   gint row_stride = table->max_seq_len + 2; 
   guint16 *seq; 
-  
+  gint i;
+
   /* Will never match, if the sequence in the compose buffer is longer
    * than the sequences in the table.  Further, compare_seq (key, val)
    * will overrun val if key is longer than val. */
   if (n_compose > table->max_seq_len)
     return FALSE;
   
+  printf ("%s: n_compose=%d compose_buffer=", __FUNCTION__, n_compose);
+  for (i = 0; i < n_compose; i++)
+    printf ("%x ", context_simple->compose_buffer[i]);
+
   seq = bsearch (context_simple->compose_buffer,
 		 table->data, table->n_seqs,
 		 sizeof (guint16) *  row_stride, 
@@ -1092,20 +942,119 @@
 		
 		  g_signal_emit_by_name (context_simple, "preedit_changed");
 
+		  printf ("tentative_match=%x returning TRUE\n");
 		  return TRUE;
 		}
 	    }
 
+	  printf ("committing %x ", value);
 	  gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
 	  context_simple->compose_buffer[0] = 0;
 	}
       
+      printf ("returning TRUE\n");
       return TRUE;
     }
 
+  printf ("returning FALSE\n");
   return FALSE;
 }
 
+#define IS_DEAD_KEY(k) \
+    (((k) >= GDK_dead_grave && (k) <= GDK_dead_horn) || \
+     g_unichar_type (gdk_keyval_to_unicode (k)) == G_UNICODE_NON_SPACING_MARK)
+
+static gboolean
+check_algorithmically (GtkIMContextSimple    *context_simple,
+		       gint                   n_compose)
+
+{
+  int i;
+  gunichar combination_buffer[GTK_MAX_COMPOSE_LEN];
+  gchar *combination_utf8, *nfc;
+
+  printf ("%s: ", __FUNCTION__);
+
+  for (i = 0; i < n_compose && IS_DEAD_KEY (context_simple->compose_buffer[i]); i++)
+    ;
+  if (i == n_compose)
+    {
+      printf ("only dead keys, returning TRUE\n");
+      return TRUE;
+    }
+
+  if (i > 0 && i == n_compose - 1)
+    {
+      combination_buffer[0] = gdk_keyval_to_unicode (context_simple->compose_buffer[i]);
+      combination_buffer[n_compose] = 0;
+      i--;
+      while (i >= 0)
+	{
+	  switch (context_simple->compose_buffer[i])
+	    {
+#define CASE(keysym, unicode) \
+	    case GDK_dead_##keysym: combination_buffer[i+1] = unicode; break
+
+	    CASE (grave, 0x0300);
+	    CASE (acute, 0x0301);
+	    CASE (circumflex, 0x0302);
+	    CASE (tilde, 0x0303);
+	    CASE (macron, 0x0304);
+	    CASE (breve, 0x0306);
+	    CASE (abovedot, 0x0307);
+	    CASE (diaeresis, 0x0308);
+	    CASE (abovering, 0x030A);
+	    CASE (doubleacute, 0x030B);
+	    CASE (caron, 0x030C);
+	    CASE (cedilla, 0x0327);
+	    CASE (ogonek, 0x0328);
+	    CASE (iota, 0x0345); /* ??? */
+	    CASE (voiced_sound, 0x032C);
+#if 0
+	    CASE (semivoiced_sound, ?);
+#endif
+	    CASE (belowdot, 0x0323);
+	    CASE (hook, 0x0309);
+	    CASE (horn, 0x031B);
+#undef CASE
+	    default:
+	      combination_buffer[i+1] = gdk_keyval_to_unicode (context_simple->compose_buffer[i]);
+	    }
+	  i--;
+	}
+      printf ("combination_buffer:");
+      for (i = 0; i < n_compose; i++)
+	printf ("%x ", combination_buffer[i]);
+      
+      if (n_compose > 2)
+	{
+	  g_unicode_canonical_ordering (combination_buffer, n_compose);
+	  printf ("in canonical order:");
+	  for (i = 0; i < n_compose; i++)
+	    printf ("%x ", combination_buffer[i]);
+	}
+      combination_utf8 = g_ucs4_to_utf8 (combination_buffer, -1, NULL, NULL, NULL);
+      nfc = g_utf8_normalize (combination_utf8, -1, G_NORMALIZE_NFC);
+      if (g_utf8_strlen (nfc, -1) == 1)
+	{
+	  gunichar value = g_utf8_get_char (nfc);
+	  printf ("committing %x ", value);
+	  gtk_im_context_simple_commit_char (GTK_IM_CONTEXT (context_simple), value);
+	  context_simple->compose_buffer[0] = 0;
+
+	  g_free (combination_utf8);
+	  g_free (nfc);
+	  printf ("returning TRUE\n");
+	  return TRUE;
+	}
+      g_free (combination_utf8);
+      g_free (nfc);
+    }
+
+  printf ("returning FALSE\n");
+  return FALSE;
+}
+
 /* In addition to the table-driven sequences, we allow Unicode hex
  * codes to be entered. The method chosen here is similar to the
  * one recommended in ISO 14755, but not exactly the same, since we
@@ -1523,6 +1472,9 @@
   
       if (check_table (context_simple, &gtk_compose_table, n_compose))
         return TRUE;
+
+      if (check_algorithmically (context_simple, n_compose))
+	return TRUE;
     }
   
   /* The current compose_buffer doesn't match anything */
