changeset 22703:15e0119749cf

(Vgeneric_character_list): New variable. (init_charset_once): Init and staticpro it. (Fgeneric_character_list): New function. (syms_of_charset): defsubr it.
author Kenichi Handa <handa@m17n.org>
date Mon, 06 Jul 1998 06:33:55 +0000
parents 1e265354a43a
children f148cf6092bb
files src/charset.c
diffstat 1 files changed, 29 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/charset.c	Mon Jul 06 06:33:55 1998 +0000
+++ b/src/charset.c	Mon Jul 06 06:33:55 1998 +0000
@@ -105,6 +105,9 @@
    to multibyte codes, or nil.  */
 Lisp_Object Vnonascii_translation_table;
 
+/* List of all possible generic characters.  */
+Lisp_Object Vgeneric_character_list;
+
 #define min(X, Y) ((X) < (Y) ? (X) : (Y))
 #define max(X, Y) ((X) > (Y) ? (X) : (Y))
 
@@ -580,6 +583,15 @@
   return Qnil;
 }
 
+DEFUN ("generic-character-list", Fgeneric_character_list,
+       Sgeneric_character_list, 0, 0, 0,
+  "Return a list of all possible generic characters.\n\
+It includes a generic character for a charset not yet defined.")
+  ()
+{
+  return Vgeneric_character_list;
+}
+
 DEFUN ("get-unused-iso-final-char", Fget_unused_iso_final_char,
        Sget_unused_iso_final_char, 2, 2, 0,
   "Return an unsed ISO's final char for a charset of DIMENISION and CHARS.\n\
@@ -1662,6 +1674,7 @@
 
   staticpro (&Vcharset_table);
   staticpro (&Vcharset_symbol_table);
+  staticpro (&Vgeneric_character_list);
 
   /* This has to be done here, before we call Fmake_char_table.  */
   Qcharset_table = intern ("charset-table");
@@ -1706,6 +1719,21 @@
   WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_12) = 2;
   WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_21) = 1;
   WIDTH_BY_CHAR_HEAD (LEADING_CODE_PRIVATE_22) = 2;
+
+  {
+    Lisp_Object val = Qnil;
+
+    for (i = 0x81; i < 0x90; i++)
+      val = Fcons (make_number ((i - 0x70) << 7), val);
+    for (; i < 0x9A; i++)
+      val = Fcons (make_number ((i - 0x8F) << 14), val);
+    for (i = 0xA0; i < 0xF0; i++)
+      val = Fcons (make_number ((i - 0x70) << 7), val);
+    for (; i < 0xFF; i++)
+      val = Fcons (make_number ((i - 0xE0) << 14), val);
+    val = Fcons (make_number (GENERIC_COMPOSITION_CHAR), val);
+    Vgeneric_character_list = Fnreverse (val);
+  }
 }
 
 #ifdef emacs
@@ -1737,6 +1765,7 @@
   CHARSET_SYMBOL (CHARSET_COMPOSITION) = Qcomposition;
 
   defsubr (&Sdefine_charset);
+  defsubr (&Sgeneric_character_list);
   defsubr (&Sget_unused_iso_final_char);
   defsubr (&Sdeclare_equiv_charset);
   defsubr (&Sfind_charset_region);