Add Hanyo-Denshi/JT code points.
[chise/xemacs-chise.git.1] / src / chartab.c
index 0b3c130..748cd29 100644 (file)
@@ -5,7 +5,7 @@
    Copyright (C) 1995, 1997, 1999 Electrotechnical Laboratory, JAPAN.
    Licensed to the Free Software Foundation.
    Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2008,
-     2010 MORIOKA Tomohiko
+     2010, 2011 MORIOKA Tomohiko
 
 This file is part of XEmacs.
 
@@ -3535,13 +3535,22 @@ Store CHARACTER's ATTRIBUTE with VALUE.
       attribute = XCHARSET_NAME (ccs);
     }
   else if ( EQ (attribute, Qrep_decomposition) ||
-           EQ (attribute, Q_decomposition) )
+           EQ (attribute, Q_decomposition) ||
+           !NILP (Fstring_match (build_string ("^=decomposition@[^*]+$"),
+                                 Fsymbol_name (attribute),
+                                 Qnil, Qnil))
+           )
     {
+      Lisp_Object ret;
+
       value = Fcopy_sequence (Fchar_refs_simplify_char_specs (value));
-      attribute = put_char_composition (character, value);
-      if ( !EQ (attribute, Qrep_decomposition) &&
+      ret = put_char_composition (character, value);
+      if ( !EQ (ret, Qrep_decomposition) &&
           SYMBOLP (XCAR (value)) )
-       value = XCDR (value);
+       {
+         attribute = ret;
+         value = XCDR (value);
+       }
     }
   else if (EQ (attribute, Qto_ucs))
     {
@@ -4233,6 +4242,20 @@ implementation does not coalesce ranges all of whose values are the same.
   return slarg.retval;
 }
 
+static Lisp_Object
+allocate_character ()
+{
+  int cid = XINT (Vnext_defined_char_id);
+
+  if (cid <= 0xE00000)
+    {
+      Vnext_defined_char_id = make_int (cid + 1);
+      return make_char (cid);
+    }
+  else
+    return Qnil;
+}
+
 DEFUN ("define-char", Fdefine_char, 1, 1, 0, /*
 Store character's ATTRIBUTES.
 */
@@ -4281,7 +4304,7 @@ Store character's ATTRIBUTES.
            }
          rest = Fcdr (rest);
        }
-#if 1
+#if 0
       {
        int cid = XINT (Vnext_defined_char_id);
 
@@ -4293,16 +4316,9 @@ Store character's ATTRIBUTES.
          }
       }
 #else
-      if ( (!NILP (code = Fcdr (Fassq (Qto_ucs, attributes)))) )
-       {
-         if (!INTP (code))
-           signal_simple_error ("Invalid argument", attributes);
-         else
-           character = make_char (XINT (code) + 0x100000);
-         goto setup_attributes;
-       }
+      if ( NILP (character = allocate_character ()) )
 #endif
-      return Qnil;
+       return Qnil;
     }
   else if (!INTP (code))
     signal_simple_error ("Invalid argument", attributes);