]> git.eshelyaron.com Git - emacs.git/commitdiff
(Fcopy_syntax_table): Set default to nil.
authorRichard M. Stallman <rms@gnu.org>
Sat, 24 Feb 1996 20:03:07 +0000 (20:03 +0000)
committerRichard M. Stallman <rms@gnu.org>
Sat, 24 Feb 1996 20:03:07 +0000 (20:03 +0000)
Set the parent only if it was nil.

src/syntax.c

index f21b592fd3eb3bc038e8308155e07a2494a21f62..8c08aa56a1038b2427c9e8319af45cb916e1170d 100644 (file)
@@ -163,7 +163,16 @@ It is a copy of the TABLE, which defaults to the standard syntax table.")
     table = Vstandard_syntax_table;
 
   copy = Fcopy_sequence (table);
-  Fset_char_table_parent (copy, Vstandard_syntax_table);
+
+  /* Only the standard syntax table should have a default element.
+     Other syntax tables should inherit from parents instead.  */
+  XCHAR_TABLE (copy)->defalt = Qnil;
+
+  /* Copied syntax tables should all have parents.
+     If we copied one with no parent, such as the standard syntax table,
+     use the standard syntax table as the copy's parent.  */
+  if (NILP (XCHAR_TABLE (copy)->parent))
+    Fset_char_table_parent (copy, Vstandard_syntax_table);
   return copy;
 }