changeset 93288:afe160d77eb3

(Fdefine_charset_internal): Change the way of registering charsets in Vcharset_order_list. (syms_of_charset): Make the charset `eight-bit' supplementary.
author Kenichi Handa <handa@m17n.org>
date Thu, 27 Mar 2008 11:30:34 +0000
parents d72bd8fa56db
children 9f6ecb7aee14
files src/charset.c
diffstat 1 files changed, 24 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Thu Mar 27 11:29:14 2008 +0000
+++ b/src/charset.c	Thu Mar 27 11:30:34 2008 +0000
@@ -1058,8 +1058,29 @@
 	Vcharset_ordered_list = nconc2 (Vcharset_ordered_list,
 					Fcons (make_number (id), Qnil));
       else
-	Vcharset_ordered_list = Fcons (make_number (id),
-				       Vcharset_ordered_list);
+	{
+	  Lisp_Object tail;
+
+	  for (tail = Vcharset_ordered_list; CONSP (tail); tail = XCDR (tail))
+	    {
+	      struct charset *cs = CHARSET_FROM_ID (XINT (XCAR (tail)));
+
+	      if (cs->supplementary_p)
+		break;
+	    }
+	  if (EQ (tail, Vcharset_ordered_list))
+	    Vcharset_ordered_list = Fcons (make_number (id),
+					   Vcharset_ordered_list);
+	  else if (NILP (tail))
+	    Vcharset_ordered_list = nconc2 (Vcharset_ordered_list,
+					    Fcons (make_number (id), Qnil));
+	  else
+	    {
+	      val = Fcons (XCAR (tail), XCDR (tail));
+	      XSETCDR (tail, val);
+	      XSETCAR (tail, make_number (id));
+	    }
+	}
       charset_ordered_list_tick++;
     }
 
@@ -2161,7 +2182,7 @@
 			       0, MAX_UNICODE_CHAR, -1, 0, -1, 1, 0, 0);
   charset_eight_bit
     = define_charset_internal (Qeight_bit, 1, "\x80\xFF\x00\x00\x00\x00",
-			       128, 255, -1, 0, -1, 0, 0,
+			       128, 255, -1, 0, -1, 0, 1,
 			       MAX_5_BYTE_CHAR + 1);
 }