From 0551bde3a4535c6880a3924ec29b8ffd1a22534b Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 7 Apr 1997 07:12:13 +0000 Subject: [PATCH] (Fmake_char_table): Adjusted for the new structure of Lisp_Char_Table. (make_sub_char_table): New function. --- src/alloc.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/alloc.c b/src/alloc.c index 0e0241124bf..ad9e2dd1401 100644 --- a/src/alloc.c +++ b/src/alloc.c @@ -778,20 +778,36 @@ The property's value should be an integer between 0 and 10.") 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.") -- 2.39.5