handle guile exceptions
[bpt/emacs.git] / src / chartab.c
index b7b9590..3abe322 100644 (file)
@@ -141,7 +141,8 @@ static Lisp_Object
 make_sub_char_table (int depth, int min_char, Lisp_Object defalt)
 {
   Lisp_Object table;
-  int size = CHAR_TABLE_STANDARD_SLOTS + chartab_size[depth];
+  int size = (PSEUDOVECSIZE (struct Lisp_Sub_Char_Table, contents)
+             + chartab_size[depth]);
 
   table = Fmake_vector (make_number (size), defalt);
   XSETPVECTYPE (XVECTOR (table), PVEC_SUB_CHAR_TABLE);
@@ -1220,9 +1221,7 @@ uniprop_decode_value_run_length (Lisp_Object table, Lisp_Object value)
 static uniprop_decoder_t uniprop_decoder [] =
   { uniprop_decode_value_run_length };
 
-static int uniprop_decoder_count
-  = (sizeof uniprop_decoder) / sizeof (uniprop_decoder[0]);
-
+static const int uniprop_decoder_count = ARRAYELTS (uniprop_decoder);
 
 /* Return the decoder of char-table TABLE or nil if none.  */
 
@@ -1271,7 +1270,7 @@ uniprop_encode_value_run_length (Lisp_Object table, Lisp_Object value)
 
 
 /* Encode VALUE as an element of char-table TABLE which adopts RUN-LENGTH
-   compression and contains numbers as elements .  */
+   compression and contains numbers as elements.  */
 
 static Lisp_Object
 uniprop_encode_value_numeric (Lisp_Object table, Lisp_Object value)
@@ -1300,9 +1299,7 @@ static uniprop_encoder_t uniprop_encoder[] =
     uniprop_encode_value_run_length,
     uniprop_encode_value_numeric };
 
-static int uniprop_encoder_count
-  = (sizeof uniprop_encoder) / sizeof (uniprop_encoder[0]);
-
+static const int uniprop_encoder_count = ARRAYELTS (uniprop_encoder);
 
 /* Return the encoder of char-table TABLE or nil if none.  */
 
@@ -1412,21 +1409,9 @@ CHAR-TABLE must be what returned by `unicode-property-table-internal'. */)
 void
 syms_of_chartab (void)
 {
-  DEFSYM (Qchar_code_property_table, "char-code-property-table");
+#include "chartab.x"
 
-  defsubr (&Smake_char_table);
-  defsubr (&Schar_table_parent);
-  defsubr (&Schar_table_subtype);
-  defsubr (&Sset_char_table_parent);
-  defsubr (&Schar_table_extra_slot);
-  defsubr (&Sset_char_table_extra_slot);
-  defsubr (&Schar_table_range);
-  defsubr (&Sset_char_table_range);
-  defsubr (&Soptimize_char_table);
-  defsubr (&Smap_char_table);
-  defsubr (&Sunicode_property_table_internal);
-  defsubr (&Sget_unicode_property_internal);
-  defsubr (&Sput_unicode_property_internal);
+  DEFSYM (Qchar_code_property_table, "char-code-property-table");
 
   /* Each element has the form (PROP . TABLE).
      PROP is a symbol representing a character property.