Sync up with r21-4-22-chise-0_25-10.
[chise/xemacs-chise.git] / src / mule-charset.c
index 9ccd480..a60e790 100644 (file)
@@ -1140,35 +1140,43 @@ decode_builtin_char (Lisp_Object charset, int code_point)
 }
 
 int
-charset_code_point (Lisp_Object charset, Emchar ch, int defined_only)
+charset_code_point (Lisp_Object charset, Emchar ch, int accepted_mode)
 {
-  Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (charset);
   Lisp_Object ret;
 
-  if ( CHAR_TABLEP (encoding_table)
-       && INTP (ret = get_char_id_table (XCHAR_TABLE(encoding_table),
-                                        ch)) )
-    return XINT (ret);
-  else
+  if ( accepted_mode >= 0 )
+    {
+      Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (charset);
+
+      if ( CHAR_TABLEP (encoding_table)
+          && !UNBOUNDP (ret = get_char_id_table (XCHAR_TABLE(encoding_table),
+                                                 ch)) )
+       if ( INTP (ret) )
+         return XINT (ret);
+       else
+         return -1;
+    }
     {
       Lisp_Object mother = XCHARSET_MOTHER (charset);
       int min = XCHARSET_MIN_CODE (charset);
       int max = XCHARSET_MAX_CODE (charset);
       int code = -1;
 
-      if ( CHARSETP (mother) )
-       {
-         if (XCHARSET_FINAL (charset) >= '0')
-           code = charset_code_point (mother, ch, 1);
-         else
-           code = charset_code_point (mother, ch, defined_only);
-       }
-      else if (defined_only)
+      if ( CHARSETP (mother) && ( accepted_mode >= 0)
+          && ( XCHARSET_FINAL (charset) >= '0' )
+          )
+       code = charset_code_point (mother, ch, CHAR_DEFINED_ONLY);
+      else if ( CHARSETP (mother)
+               && ( XCHARSET_FINAL (charset) < '0' )
+               )
+       code = charset_code_point (mother, ch, accepted_mode);
+      else if ( accepted_mode == CHAR_DEFINED_ONLY )
        return -1;
       else if ( ((max == 0) && CHARSETP (mother)
                 && (XCHARSET_FINAL (charset) == 0))
                || ((min <= ch) && (ch <= max)) )
        code = ch;
+
       if ( ((max == 0) && CHARSETP (mother) && (code >= 0))
           || ((min <= code) && (code <= max)) )
        {
@@ -1261,7 +1269,7 @@ charset_code_point (Lisp_Object charset, Emchar ch, int defined_only)
              exit (-1);
            }
        }
-      else if (defined_only)
+      else if ( accepted_mode == CHAR_DEFINED_ONLY )
        return -1;
       else if ( ( XCHARSET_FINAL (charset) >= '0' ) &&
                ( XCHARSET_MIN_CODE (charset) == 0 )
@@ -3488,7 +3496,7 @@ complex_vars_of_mule_charset (void)
                  build_string ("JIS X0208"),
                  build_string ("JIS X0208 Common"),
                  build_string ("JIS X0208 Common part"),
-                 build_string ("jisx0208\\.1990"),
+                 build_string ("jisx0208"),
                  - LEADING_BYTE_JAPANESE_JISX0208_1978,
                  Qnil,
                  MIN_CHAR_JIS_X0208_1990,