changeset 14661:46ba65e7976c

(Fcopy_syntax_table): Set default to nil. Set the parent only if it was nil.
author Richard M. Stallman <rms@gnu.org>
date Sat, 24 Feb 1996 20:03:07 +0000
parents 071940e2a563
children 9e8607589f03
files src/syntax.c
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/syntax.c	Sat Feb 24 10:15:08 1996 +0000
+++ b/src/syntax.c	Sat Feb 24 20:03:07 1996 +0000
@@ -163,7 +163,16 @@
     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;
 }