+2002-07-17 MORIOKA Tomohiko <tomo@mousai.as.wakwak.ne.jp>
+
+ * lisp.h: Add an EXFUN for `Fchar_ref_p'.
+
+ * fns.c (Qideographic_structure): New variable.
+ (Qkeyword_char): New variable.
+ (ids_format_unit): New function.
+ (Fideographic_structure_to_ids): New function.
+ (syms_of_fns): Add new symbols `ideographic-structure' and
+ `:char'; add new builtin function `ideographic-structure-to-ids'.
+
+ * data.c (Fchar_ref_p): New function.
+ (syms_of_data): Add new builtin function `char-ref-p'.
+
+ * chartab.h: Add an EXFUN for `Ffind_char'.
+
2002-07-07 MORIOKA Tomohiko <tomo@mousai.as.wakwak.ne.jp>
* text-coding.c (decode_coding_utf8): Use `COMPOSE_FLUSH_CHARS'
/* Declarations having to do with Mule char tables.
Copyright (C) 1992 Free Software Foundation, Inc.
Copyright (C) 1995 Sun Microsystems, Inc.
- Copyright (C) 1999,2000,2001 MORIOKA Tomohiko
+ Copyright (C) 1999,2000,2001,2002 MORIOKA Tomohiko
This file is part of XEmacs.
EXFUN (Fput_char_attribute, 3);
+EXFUN (Ffind_char, 1);
+
/************************************************************************/
/* Char-ID Tables */
{
return CHAR_OR_CHAR_INTP (object) || STRINGP (object) ? Qt : Qnil;
}
+
+DEFUN ("char-ref-p", Fchar_ref_p, 1, 1, 0, /*
+Return t if OBJECT is a character-reference.
+*/
+ (object))
+{
+ return CONSP (object) && KEYWORDP (XCAR (object)) ? Qt : Qnil;
+}
\f
DEFUN ("integerp", Fintegerp, 1, 1, 0, /*
Return t if OBJECT is an integer.
DEFSUBR (Fchar_to_int);
DEFSUBR (Fint_to_char);
DEFSUBR (Fchar_or_char_int_p);
+ DEFSUBR (Fchar_ref_p);
DEFSUBR (Fintegerp);
DEFSUBR (Finteger_or_marker_p);
DEFSUBR (Finteger_or_char_p);
/* 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
This file is part of XEmacs.
return result;
}
\f
+Lisp_Object Qideographic_structure;
+Lisp_Object Qkeyword_char;
+
+EXFUN (Fideographic_structure_to_ids, 1);
+
+Lisp_Object ids_format_unit (Lisp_Object ids_char);
+Lisp_Object
+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 (Qucs, ids_char, Qnil));
+ else
+ {
+ Lisp_Object ret = Ffind_char (ids_char);
+
+ if (CHARP (ret))
+ return Fchar_to_string (ret);
+ else
+ {
+ ret = Fassq (Qideographic_structure, ids_char);
+
+ if (CONSP (ret))
+ return Fideographic_structure_to_ids (XCDR (ret));
+ }
+ }
+ return Qnil;
+}
+
+DEFUN ("ideographic-structure-to-ids",
+ Fideographic_structure_to_ids, 1, 1, 0, /*
+Format ideographic-structure IDS-LIST as an IDS-string.
+*/
+ (ids_list))
+{
+ Lisp_Object dest = Qnil;
+
+ while (CONSP (ids_list))
+ {
+ Lisp_Object cell = XCAR (ids_list);
+
+ if (!NILP (Fchar_ref_p (cell)))
+ cell = Fplist_get (cell, Qkeyword_char, Qnil);
+ dest = concat2 (dest, ids_format_unit (cell));
+ ids_list = XCDR (ids_list);
+ }
+ return dest;
+}
+\f
Lisp_Object Qyes_or_no_p;
void
defsymbol (&Qstring_lessp, "string-lessp");
defsymbol (&Qidentity, "identity");
+ defsymbol (&Qideographic_structure, "ideographic-structure");
+ defsymbol (&Qkeyword_char, ":char");
defsymbol (&Qyes_or_no_p, "yes-or-no-p");
DEFSUBR (Fidentity);
DEFSUBR (Fbase64_encode_string);
DEFSUBR (Fbase64_decode_region);
DEFSUBR (Fbase64_decode_string);
+ DEFSUBR (Fideographic_structure_to_ids);
}
void