From cb73cc7f011b2a258697b9a5f370aaa5c3c4e235 Mon Sep 17 00:00:00 2001 From: tomo Date: Sun, 3 Oct 1999 14:25:47 +0000 Subject: [PATCH] (MAKE_CHAR): Allow nested decoding-table. --- src/char-ucs.h | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/char-ucs.h b/src/char-ucs.h index 42d98ef..abfb6f8 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -378,15 +378,26 @@ INLINE Emchar MAKE_CHAR (Lisp_Object charset, int c1, int c2) { Lisp_Object decoding_table = XCHARSET_DECODING_TABLE (charset); - int idx; + int ofs, idx; Lisp_Object ch; if (!EQ (decoding_table, Qnil) - && (0 <= (idx = c1 - (XCHARSET_CHARS (charset) == 94 ? 33 : 32))) + && (0 <= (idx = + c1 - (ofs = (XCHARSET_CHARS (charset) == 94 ? 33 : 32)))) && (idx < XVECTOR_LENGTH (decoding_table)) && !EQ (ch = XVECTOR_DATA(decoding_table)[idx], Qnil)) - return XCHAR (ch); - else if (EQ (charset, Vcharset_katakana_jisx0201)) + { + if (VECTORP (ch)) + { + if ((0 <= (idx = c2 - ofs)) + && (idx < XVECTOR_LENGTH (ch)) + && !EQ (ch = XVECTOR_DATA(ch)[idx], Qnil)) + return XCHAR (ch); + } + else + return XCHAR (ch); + } + if (EQ (charset, Vcharset_katakana_jisx0201)) if (c1 < 0x60) return c1 + MIN_CHAR_HALFWIDTH_KATAKANA - 33; else -- 1.7.10.4