changeset 17328:e2a6f31ee014

(Fmake_char_table): Adjusted for the new structure of Lisp_Char_Table. (make_sub_char_table): New function.
author Kenichi Handa <handa@m17n.org>
date Mon, 07 Apr 1997 07:12:13 +0000
parents 0cb065f8702e
children 4d2c79262170
files src/alloc.c
diffstat 1 files changed, 18 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/alloc.c	Mon Apr 07 07:12:13 1997 +0000
+++ b/src/alloc.c	Mon Apr 07 07:12:13 1997 +0000
@@ -778,20 +778,36 @@
   Lisp_Object vector;
   Lisp_Object n;
   CHECK_SYMBOL (purpose, 1);
-  /* For a deeper char-table, PURPOSE can be nil.  */
-  n = NILP (purpose) ? 0 : Fget (purpose, Qchar_table_extra_slots);
+  n = Fget (purpose, Qchar_table_extra_slots);
   CHECK_NUMBER (n, 0);
   if (XINT (n) < 0 || XINT (n) > 10)
     args_out_of_range (n, Qnil);
   /* Add 2 to the size for the defalt and parent slots.  */
   vector = Fmake_vector (make_number (CHAR_TABLE_STANDARD_SLOTS + XINT (n)),
 			 init);
+  XCHAR_TABLE (vector)->top = Qt;
   XCHAR_TABLE (vector)->parent = Qnil;
   XCHAR_TABLE (vector)->purpose = purpose;
   XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
   return vector;
 }
 
+/* Return a newly created sub char table with default value DEFALT.
+   Since a sub char table does not appear as a top level Emacs Lisp
+   object, we don't need a Lisp interface to make it.  */
+
+Lisp_Object
+make_sub_char_table (defalt)
+     Lisp_Object defalt;
+{
+  Lisp_Object vector
+    = Fmake_vector (make_number (SUB_CHAR_TABLE_STANDARD_SLOTS), Qnil);
+  XCHAR_TABLE (vector)->top = Qnil;
+  XCHAR_TABLE (vector)->defalt = defalt;
+  XSETCHAR_TABLE (vector, XCHAR_TABLE (vector));
+  return vector;
+}
+
 DEFUN ("vector", Fvector, Svector, 0, MANY, 0,
   "Return a newly created vector with specified arguments as elements.\n\
 Any number of arguments, even zero arguments, are allowed.")