X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2Ffns.c;h=29ef8fa98f332fa9bec196c79a17271313330f0c;hb=170dcc3172bcd984e972e7be768959ea0f884f1e;hp=03677ede59c5eb18940e3f8412bbbe9cd844d820;hpb=a5812bf2ff9a9cf40f4ff78dcb83f5b4c295bd18;p=chise%2Fxemacs-chise.git.1 diff --git a/src/fns.c b/src/fns.c index 03677ed..29ef8fa 100644 --- a/src/fns.c +++ b/src/fns.c @@ -1,7 +1,7 @@ /* Random utility Lisp functions. Copyright (C) 1985, 86, 87, 93, 94, 95 Free Software Foundation, Inc. Copyright (C) 1995, 1996 Ben Wing. - Copyright (C) 2002 MORIOKA Tomohiko + Copyright (C) 2002, 2003, 2004 MORIOKA Tomohiko This file is part of XEmacs. @@ -3774,7 +3774,7 @@ ids_format_unit (Lisp_Object ids_char) if (CHARP (ids_char)) return Fchar_to_string (ids_char); else if (INTP (ids_char)) - return Fchar_to_string (Fdecode_char (Qmap_ucs, ids_char, Qnil)); + return Fchar_to_string (Fdecode_char (Qmap_ucs, ids_char, Qnil, Qnil)); else { Lisp_Object ret = Ffind_char (ids_char); @@ -3817,13 +3817,29 @@ Lisp_Object simplify_char_spec (Lisp_Object char_spec) { if (CHARP (char_spec)) - return char_spec; + { + Lisp_Object ccs; + int code_point = ENCODE_CHAR (XCHAR (char_spec), ccs); + + if (code_point >= 0) + { + int cid = decode_defined_char (ccs, code_point, Qnil); + + if (cid >= 0) + return make_char (cid); + } + return char_spec; + } else if (INTP (char_spec)) - return Fdecode_char (Qmap_ucs, char_spec, Qnil); + return Fdecode_char (Qmap_ucs, char_spec, Qnil, Qnil); else { +#if 0 Lisp_Object ret = Ffind_char (char_spec); - +#else + Lisp_Object ret = Fdefine_char (char_spec); +#endif + if (CHARP (ret)) return ret; else