From: tomo Date: Thu, 31 Oct 2002 08:09:19 +0000 (+0000) Subject: (charset_code_point): Add new argument `defined_only'. X-Git-Tag: r21-4-9-utf-2000-0_19-ecdo~2 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=6e7930aa80decf1ef0944e099dfa135f41673953;p=chise%2Fxemacs-chise.git- (charset_code_point): Add new argument `defined_only'. (Fencode_char): Add new optional argument `defined_only'. --- diff --git a/src/mule-charset.c b/src/mule-charset.c index 05de9f2..f670588 100644 --- a/src/mule-charset.c +++ b/src/mule-charset.c @@ -1097,7 +1097,7 @@ decode_builtin_char (Lisp_Object charset, int code_point) } int -charset_code_point (Lisp_Object charset, Emchar ch) +charset_code_point (Lisp_Object charset, Emchar ch, int defined_only) { Lisp_Object encoding_table = XCHARSET_ENCODING_TABLE (charset); Lisp_Object ret; @@ -1114,7 +1114,9 @@ charset_code_point (Lisp_Object charset, Emchar ch) int code; if ( CHARSETP (mother) ) - code = charset_code_point (mother, ch); + code = charset_code_point (mother, ch, defined_only); + else if (defined_only) + return -1; else code = ch; if ( ((max == 0) && CHARSETP (mother)) || @@ -2475,16 +2477,17 @@ N defaults to 0 if omitted. } #ifdef UTF2000 -DEFUN ("encode-char", Fencode_char, 2, 2, 0, /* +DEFUN ("encode-char", Fencode_char, 2, 3, 0, /* Return code-point of CHARACTER in specified CHARSET. */ - (character, charset)) + (character, charset, defined_only)) { int code_point; CHECK_CHAR_COERCE_INT (character); charset = Fget_charset (charset); - code_point = charset_code_point (charset, XCHAR (character)); + code_point = charset_code_point (charset, XCHAR (character), + !NILP (defined_only)); if (code_point >= 0) return make_int (code_point); else