From 1a770ddb7b78eb146f0771eadd34601f465a674b Mon Sep 17 00:00:00 2001 From: tomo Date: Mon, 16 Dec 2002 16:56:16 +0000 Subject: [PATCH] Sync with r21-2-19-utf-2000-0_8-1. --- lisp/ChangeLog | 9 +++++ lisp/mule/chinese.el | 41 ++++++++++++----------- src/ChangeLog | 40 +++++++++++++++++++++++ src/char-ucs.h | 6 ++-- src/mule-charset.c | 89 +++++++------------------------------------------- src/text-coding.c | 20 +++++++----- 6 files changed, 96 insertions(+), 109 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 84c6eb5..294d7d7 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,12 @@ +1999-09-21 MORIOKA Tomohiko + + * mule/chinese.el (chinese-cns11643-3): Define it even if + `utf-2000' is provided. + (chinese-cns11643-4): Likewise. + (chinese-cns11643-5): Likewise. + (chinese-cns11643-6): Likewise. + (chinese-cns11643-7): Likewise. + 1999-09-14 MORIOKA Tomohiko * mule/mule-charset.el (default-coded-charset-priority-list): Add diff --git a/lisp/mule/chinese.el b/lisp/mule/chinese.el index accb940..7523892 100644 --- a/lisp/mule/chinese.el +++ b/lisp/mule/chinese.el @@ -50,27 +50,26 @@ ;; that appear once in some ancient manuscript and whose meaning ;; is unknown. -(unless (featurep 'utf-2000) - (flet - ((make-chinese-cns11643-charset - (name plane final) - (make-charset - name (concat "CNS 11643 Plane " plane " (Chinese traditional)") - `(registry - ,(concat "CNS11643[.-]\\(.*[.-]\\)?" plane "$") - dimension 2 - chars 94 - final ,final - graphic 0)) - (modify-syntax-entry name "w") - (modify-category-entry name ?t) - )) - (make-chinese-cns11643-charset 'chinese-cns11643-3 "3" ?I) - (make-chinese-cns11643-charset 'chinese-cns11643-4 "4" ?J) - (make-chinese-cns11643-charset 'chinese-cns11643-5 "5" ?K) - (make-chinese-cns11643-charset 'chinese-cns11643-6 "6" ?L) - (make-chinese-cns11643-charset 'chinese-cns11643-7 "7" ?M) - )) +(flet + ((make-chinese-cns11643-charset + (name plane final) + (make-charset + name (concat "CNS 11643 Plane " plane " (Chinese traditional)") + `(registry + ,(concat "CNS11643[.-]\\(.*[.-]\\)?" plane "$") + dimension 2 + chars 94 + final ,final + graphic 0)) + (modify-syntax-entry name "w") + (modify-category-entry name ?t) + )) + (make-chinese-cns11643-charset 'chinese-cns11643-3 "3" ?I) + (make-chinese-cns11643-charset 'chinese-cns11643-4 "4" ?J) + (make-chinese-cns11643-charset 'chinese-cns11643-5 "5" ?K) + (make-chinese-cns11643-charset 'chinese-cns11643-6 "6" ?L) + (make-chinese-cns11643-charset 'chinese-cns11643-7 "7" ?M) + ) ;; ISO-IR-165 (CCITT Extended GB) ;; It is based on CCITT Recommendation T.101, includes GB 2312-80 + diff --git a/src/ChangeLog b/src/ChangeLog index 2e91401..6f01219 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,43 @@ +1999-09-23 MORIOKA Tomohiko + + * mule-charset.c (Fmake_reverse_direction_charset): Fix compile + error with non-UTF-2000-Mule. + +1999-09-21 MORIOKA Tomohiko + + * mule-charset.c (Vcharset_chinese_cns11643_3): Deleted [defined + in lisp again]. + (Vcharset_chinese_cns11643_4): Likewise. + (Vcharset_chinese_cns11643_5): Likewise. + (Vcharset_chinese_cns11643_6): Likewise. + (Vcharset_chinese_cns11643_7): Likewise. + (Qchinese_cns11643_3): Likewise. + (Qchinese_cns11643_4): Likewise. + (Qchinese_cns11643_5): Likewise. + (Qchinese_cns11643_6): Likewise. + (Qchinese_cns11643_7): Likewise. + (syms_of_mule_charset): Move definitions for `chinese-cns11643-3', + `chinese-cns11643-4', `chinese-cns11643-5', `chinese-cns11643-6' + and `chinese-cns11643-7' to lisp/mule/chinese.el. + (complex_vars_of_mule_charset): Likewise. + +1999-09-18 MORIOKA Tomohiko + + * mule-charset.c (charset_get_byte1): Fix bug about 94- and + 96-set. + (Fmake_reverse_direction_charset): Inherit CHARSET_DECODING_TABLE, + CHARSET_UCS_MIN, CHARSET_UCS_MAX and CHARSET_CODE_OFFSET. + +1999-09-17 MORIOKA Tomohiko + + * char-ucs.h (MIN_CHAR_HALFWIDTH_KATAKANA): Changed to 0xFF61 from + 0xFF60. + (MAKE_CHAR): Change offset for katakana-jisx0201 to 33 from 0x20. + (breakup_char_1): Likewise. + + * text-coding.c (char_encode_iso2022): Keep designated charsets if + one of them includes the specified character. + 1999-09-14 MORIOKA Tomohiko * mule-charset.c: Update `utf-2000-version' to 0.8 (Kami). diff --git a/src/char-ucs.h b/src/char-ucs.h index b243fbd..462c635 100644 --- a/src/char-ucs.h +++ b/src/char-ucs.h @@ -339,7 +339,7 @@ CHARSET_BY_ATTRIBUTES (unsigned int type, unsigned char final, int dir) #define MIN_CHAR_THAI 0x0E00 #define MAX_CHAR_THAI 0x0E5F -#define MIN_CHAR_HALFWIDTH_KATAKANA 0xFF60 +#define MIN_CHAR_HALFWIDTH_KATAKANA 0xFF61 #define MAX_CHAR_HALFWIDTH_KATAKANA 0xFF9F #define MIN_CHAR_94 0xE90940 @@ -366,7 +366,7 @@ MAKE_CHAR (Lisp_Object charset, int c1, int c2) return decoding_table[c1 - (XCHARSET_CHARS (charset) == 94 ? 33 : 32)]; else if (EQ (charset, Vcharset_katakana_jisx0201)) if (c1 < 0x60) - return c1 + MIN_CHAR_HALFWIDTH_KATAKANA - 0x20; + return c1 + MIN_CHAR_HALFWIDTH_KATAKANA - 33; else /* return MIN_CHAR_94 + ('I' - '0') * 94 + (c1 - 33); */ return ' '; @@ -482,7 +482,7 @@ breakup_char_1 (Emchar c, Lisp_Object *charset, int *c1, int *c2) && (c <= MAX_CHAR_HALFWIDTH_KATAKANA)) { *charset = Vcharset_katakana_jisx0201; - *c1 = c - MIN_CHAR_HALFWIDTH_KATAKANA + 0x20; + *c1 = c - MIN_CHAR_HALFWIDTH_KATAKANA + 33; *c2 = 0; } else diff --git a/src/mule-charset.c b/src/mule-charset.c index f0cb41e..906e667 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -58,11 +58,6 @@ Lisp_Object Vcharset_japanese_jisx0212; Lisp_Object Vcharset_chinese_cns11643_1; Lisp_Object Vcharset_chinese_cns11643_2; #ifdef UTF2000 -Lisp_Object Vcharset_chinese_cns11643_3; -Lisp_Object Vcharset_chinese_cns11643_4; -Lisp_Object Vcharset_chinese_cns11643_5; -Lisp_Object Vcharset_chinese_cns11643_6; -Lisp_Object Vcharset_chinese_cns11643_7; Lisp_Object Vcharset_ucs_bmp; Lisp_Object Vcharset_latin_viscii_lower; Lisp_Object Vcharset_latin_viscii_upper; @@ -994,11 +989,6 @@ Lisp_Object Qascii, Qchinese_cns11643_1, Qchinese_cns11643_2, #ifdef UTF2000 - Qchinese_cns11643_3, - Qchinese_cns11643_4, - Qchinese_cns11643_5, - Qchinese_cns11643_6, - Qchinese_cns11643_7, Qucs_bmp, Qlatin_viscii_lower, Qlatin_viscii_upper, @@ -1553,14 +1543,14 @@ charset_get_byte1 (Lisp_Object charset, Emchar ch) if (((d = ch - (MIN_CHAR_94 + (XCHARSET_FINAL (charset) - '0') * 94)) >= 0) && (d < 94)) - return d + 32; + return d + 33; } else if (XCHARSET_CHARS (charset) == 96) { if (((d = ch - (MIN_CHAR_96 + (XCHARSET_FINAL (charset) - '0') * 96)) >= 0) && (d < 96)) - return d + 33; + return d + 32; } else return 0; @@ -1926,8 +1916,7 @@ character set. Recognized properties are: charset = make_charset (id, name, type, columns, graphic, final, direction, short_name, long_name, doc_string, registry, - NULL, - 0, 0, 0); + NULL, 0, 0, 0); if (!NILP (ccl_program)) XCHARSET_CCL_PROGRAM (charset) = ccl_program; return charset; @@ -1975,8 +1964,15 @@ NEW-NAME is the name of the new charset. Return the new charset. new_charset = make_charset (id, new_name, type, columns, graphic, final, direction, short_name, long_name, doc_string, registry, - NULL, - 0, 0, 0); +#ifdef UTF2000 + CHARSET_DECODING_TABLE(cs), + CHARSET_UCS_MIN(cs), + CHARSET_UCS_MAX(cs), + CHARSET_CODE_OFFSET(cs) +#else + NULL, 0, 0, 0 +#endif +); CHARSET_REVERSE_DIRECTION_CHARSET (cs) = new_charset; XCHARSET_REVERSE_DIRECTION_CHARSET (new_charset) = charset; @@ -2450,11 +2446,6 @@ syms_of_mule_charset (void) defsymbol (&Qchinese_cns11643_1, "chinese-cns11643-1"); defsymbol (&Qchinese_cns11643_2, "chinese-cns11643-2"); #ifdef UTF2000 - defsymbol (&Qchinese_cns11643_3, "chinese-cns11643-3"); - defsymbol (&Qchinese_cns11643_4, "chinese-cns11643-4"); - defsymbol (&Qchinese_cns11643_5, "chinese-cns11643-5"); - defsymbol (&Qchinese_cns11643_6, "chinese-cns11643-6"); - defsymbol (&Qchinese_cns11643_7, "chinese-cns11643-7"); defsymbol (&Qucs_bmp, "ucs-bmp"); defsymbol (&Qlatin_viscii_lower, "vietnamese-viscii-lower"); defsymbol (&Qlatin_viscii_upper, "vietnamese-viscii-upper"); @@ -2778,62 +2769,6 @@ complex_vars_of_mule_charset (void) build_string (CHINESE_CNS_PLANE_RE("2")), NULL, 0, 0, 33); #ifdef UTF2000 - staticpro (&Vcharset_chinese_cns11643_3); - Vcharset_chinese_cns11643_3 = - make_charset (LEADING_BYTE_CHINESE_CNS11643_3, Qchinese_cns11643_3, - CHARSET_TYPE_94X94, 2, 0, 'I', - CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-3"), - build_string ("CNS11643-3 (Chinese traditional)"), - build_string - ("CNS 11643 Plane 3 Chinese traditional"), - build_string (CHINESE_CNS_PLANE_RE("3")), - NULL, 0, 0, 33); - staticpro (&Vcharset_chinese_cns11643_4); - Vcharset_chinese_cns11643_4 = - make_charset (LEADING_BYTE_CHINESE_CNS11643_4, Qchinese_cns11643_4, - CHARSET_TYPE_94X94, 2, 0, 'J', - CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-4"), - build_string ("CNS11643-4 (Chinese traditional)"), - build_string - ("CNS 11643 Plane 4 Chinese traditional"), - build_string (CHINESE_CNS_PLANE_RE("4")), - NULL, 0, 0, 33); - staticpro (&Vcharset_chinese_cns11643_5); - Vcharset_chinese_cns11643_5 = - make_charset (LEADING_BYTE_CHINESE_CNS11643_5, Qchinese_cns11643_5, - CHARSET_TYPE_94X94, 2, 0, 'K', - CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-5"), - build_string ("CNS11643-5 (Chinese traditional)"), - build_string - ("CNS 11643 Plane 5 Chinese traditional"), - build_string (CHINESE_CNS_PLANE_RE("5")), - NULL, 0, 0, 33); - staticpro (&Vcharset_chinese_cns11643_6); - Vcharset_chinese_cns11643_6 = - make_charset (LEADING_BYTE_CHINESE_CNS11643_6, Qchinese_cns11643_6, - CHARSET_TYPE_94X94, 2, 0, 'L', - CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-6"), - build_string ("CNS11643-6 (Chinese traditional)"), - build_string - ("CNS 11643 Plane 6 Chinese traditional"), - build_string (CHINESE_CNS_PLANE_RE("6")), - NULL, 0, 0, 33); - staticpro (&Vcharset_chinese_cns11643_7); - Vcharset_chinese_cns11643_7 = - make_charset (LEADING_BYTE_CHINESE_CNS11643_7, Qchinese_cns11643_7, - CHARSET_TYPE_94X94, 2, 0, 'M', - CHARSET_LEFT_TO_RIGHT, - build_string ("CNS11643-7"), - build_string ("CNS11643-7 (Chinese traditional)"), - build_string - ("CNS 11643 Plane 7 Chinese traditional"), - build_string (CHINESE_CNS_PLANE_RE("7")), - NULL, 0, 0, 33); - staticpro (&Vcharset_latin_viscii_lower); Vcharset_latin_viscii_lower = make_charset (LEADING_BYTE_LATIN_VISCII_LOWER, Qlatin_viscii_lower, CHARSET_TYPE_96, 1, 1, '1', diff --git a/src/text-coding.c b/src/text-coding.c index 3a8c3fe..113f726 100644 --- a/src/text-coding.c +++ b/src/text-coding.c @@ -5041,23 +5041,27 @@ char_encode_iso2022 (struct encoding_stream *str, Emchar ch, { int reg; - BREAKUP_CHAR (ch, charset, byte1, byte2); - ensure_correct_direction (XCHARSET_DIRECTION (charset), - codesys, dst, flags, 0); - /* Now determine which register to use. */ reg = -1; for (i = 0; i < 4; i++) { - if (EQ (charset, str->iso2022.charset[i]) || - EQ (charset, - CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i))) + if ((CHARSETP (charset = str->iso2022.charset[i]) + && (byte1 = charset_get_byte1 (charset, ch))) || + (CHARSETP + (charset + = CODING_SYSTEM_ISO2022_INITIAL_CHARSET (codesys, i)) + && (byte1 = charset_get_byte1 (charset, ch)))) { reg = i; + byte2 = charset_get_byte2 (charset, ch); break; } } - + if (reg == -1) + BREAKUP_CHAR (ch, charset, byte1, byte2); + ensure_correct_direction (XCHARSET_DIRECTION (charset), + codesys, dst, flags, 0); + if (reg == -1) { if (XCHARSET_GRAPHIC (charset) != 0) -- 1.7.10.4