]> code.delx.au - gnu-emacs/blobdiff - src/syntax.c
(x_connection_closed): Add newline when printing error message on stderr.
[gnu-emacs] / 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;
 }