You should have received a copy of the GNU General Public License
along with GNU Emacs; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include <config.h>
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;
}