]> code.delx.au - gnu-emacs/blobdiff - src/casetab.c
Merge from emacs-24; up to 2013-01-03T01:56:56Z!rgm@gnu.org
[gnu-emacs] / src / casetab.c
index 76f72b26db3eb95429091ccbc3db2cc22ee16f97..b6b1c99c39fb5a7084910d77a1ea4a6a65965aaf 100644 (file)
@@ -246,16 +246,9 @@ void
 init_casetab_once (void)
 {
   register int i;
-  Lisp_Object down, up;
-  DEFSYM (Qcase_table, "case-table");
-
-  /* Intern this now in case it isn't already done.
-     Setting this variable twice is harmless.
-     But don't staticpro it here--that is done in alloc.c.  */
-  Qchar_table_extra_slots = intern_c_string ("char-table-extra-slots");
+  Lisp_Object down, up, eqv;
 
-  /* Now we are ready to set up this property, so we can
-     create char tables.  */
+  DEFSYM (Qcase_table, "case-table");
   Fput (Qcase_table, Qchar_table_extra_slots, make_number (3));
 
   down = Fmake_char_table (Qcase_table, Qnil);
@@ -275,13 +268,21 @@ init_casetab_once (void)
 
   for (i = 0; i < 128; i++)
     {
+      int c = (i >= 'a' && i <= 'z') ? i + ('A' - 'a') : i;
+      CHAR_TABLE_SET (up, i, make_number (c));
+    }
+
+  eqv = Fmake_char_table (Qcase_table, Qnil);
+
+   for (i = 0; i < 128; i++)
+     {
       int c = ((i >= 'A' && i <= 'Z') ? i + ('a' - 'A')
               : ((i >= 'a' && i <= 'z') ? i + ('A' - 'a')
                  : i));
-      CHAR_TABLE_SET (up, i, make_number (c));
+      CHAR_TABLE_SET (eqv, i, make_number (c));
     }
 
-  set_char_table_extras (down, 2, Fcopy_sequence (up));
+  set_char_table_extras (down, 2, eqv);
 
   /* Fill in what isn't filled in.  */
   set_case_table (down, 1);