From: tomo Date: Fri, 23 Jul 2004 17:41:28 +0000 (+0000) Subject: (Fsave_charset_properties): Use `true-name' only for aliases; write X-Git-Tag: r21-4-15-chise-0_21-30-ccs-props^2~1 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=87300814aa792f516c93b22c0472ab4a6f3933b7;p=chise%2Fxemacs-chise.git- (Fsave_charset_properties): Use `true-name' only for aliases; write `description'; write `mother-code-{min|max|offset|conversion}' if CHARSET_MAX_CODE is not 0. --- diff --git a/src/mule-charset.c b/src/mule-charset.c index 2887efc..0958674 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -2381,7 +2381,7 @@ Save properties of CHARSET. if ( open_chise_data_source_maybe () ) return -1; - if ( SYMBOLP (charset) ) + if ( SYMBOLP (charset) && !EQ (charset, XCHARSET_NAME (ccs)) ) { property = chise_ds_get_property (default_chise_data_source, "true-name"); @@ -2395,6 +2395,14 @@ Save properties of CHARSET. charset = XCHARSET_NAME (ccs); feature_name = XSTRING_DATA (Fsymbol_name (charset)); + property = chise_ds_get_property (default_chise_data_source, + "description"); + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, XSTRING_DATA (Fprin1_to_string + (CHARSET_DOC_STRING (cs), Qnil))); + chise_property_sync (property); + property = chise_ds_get_property (default_chise_data_source, "type"); chise_feature_set_property_value (chise_ds_get_feature (default_chise_data_source, feature_name), @@ -2443,6 +2451,78 @@ Save properties of CHARSET. property, XSTRING_DATA (Fprin1_to_string (mother, Qnil))); chise_property_sync (property); } + + if ( CHARSET_MAX_CODE (cs) != 0 ) + { + char str[16]; + + property = chise_ds_get_property (default_chise_data_source, + "mother-code-min"); + if ( CHARSET_MIN_CODE (cs) == 0 ) + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, "0"); + else + { + sprintf (str, "#x%X", CHARSET_MIN_CODE (cs)); + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, str); + } + chise_property_sync (property); + + property = chise_ds_get_property (default_chise_data_source, + "mother-code-max"); + sprintf (str, "#x%X", CHARSET_MAX_CODE (cs)); + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, str); + chise_property_sync (property); + + property = chise_ds_get_property (default_chise_data_source, + "mother-code-offset"); + if ( CHARSET_CODE_OFFSET (cs) == 0 ) + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, "0"); + else + { + sprintf (str, "#x%X", CHARSET_CODE_OFFSET (cs)); + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, str); + } + chise_property_sync (property); + + property = chise_ds_get_property (default_chise_data_source, + "mother-code-conversion"); + if ( CHARSET_CONVERSION (cs) == CONVERSION_IDENTICAL ) + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, "identical"); + else + { + Lisp_Object sym = Qnil; + + if ( CHARSET_CONVERSION (cs) == CONVERSION_94x60 ) + sym = Q94x60; + else if ( CHARSET_CONVERSION (cs) == CONVERSION_94x94x60 ) + sym = Q94x94x60; + else if ( CHARSET_CONVERSION (cs) == CONVERSION_BIG5_1 ) + sym = Qbig5_1; + else if ( CHARSET_CONVERSION (cs) == CONVERSION_BIG5_2 ) + sym = Qbig5_2; + if ( !NILP (sym) ) + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, XSTRING_DATA (Fprin1_to_string (sym, Qnil))); + else + chise_feature_set_property_value + (chise_ds_get_feature (default_chise_data_source, feature_name), + property, "unknown"); + } + chise_property_sync (property); + } return Qnil; } #endif /* HAVE_LIBCHISE */