Handle changes to the syntax table in the comment-cache branch.
commitcecc25c68f5a1834c356e18259aa2af402a70ce1
authorAlan Mackenzie <acm@muc.de>
Fri, 23 Dec 2016 20:38:11 +0000 (23 20:38 +0000)
committerAlan Mackenzie <acm@muc.de>
Fri, 23 Dec 2016 20:38:11 +0000 (23 20:38 +0000)
tree315e1bcd9a47d4feb85754e5619af17b93c22214
parent441e3b78c7b4a874e98bbc436f2b8d9771ca9d4e
Handle changes to the syntax table in the comment-cache branch.

Changes to a syntax table (by modify-syntax-entry or set-syntax-table) now
cause the literal-cache cache(s) in the affected buffer(s) to be emptied, if
the change might have an affect on the parsing of comments or strings.

* doc/emacs/programs.texi (Left Margin Paren): document that open parens may
now be freely written in column 0 inside comments.  Explain the changes to
the low level SW which make this possible.

* src/chartab.c (make-char-table): Initialize any extra slots to nil, rather
than the default value for the table's values.
(sub_char_table_ref_and_range): Export this function.
(char_table_ref_and_range_with_parents): New function.

* src/lisp.h: Export sub_char_table_ref_and_range and
char_table_ref_and_range_with_parents for chartab.c

* src/syntax.c (find_defun_start, old_back_comment, literal-cacheing-flag):
remove.
(empty_syntax_tables_buffers_literal_caches, LITERAL_MASK, SYNTAB_LITERAL)
(literally_different, syntax_table_ranges_differ_literally_p)
(least-literal-difference-between-syntax-tables)
(syntax-tables-literally-different-p)
(syntax_table_value_range_is_interesting_for_literals)
(break_off_syntax_tables_literal_relations): New functions/DEFUNs/macros.
(set-syntax-table): When the new syntax table is "literally different" from
the old, empty the buffer's literal cache.
(modify-syntax-entry): if the new syntax descriptor is "literally different"
from the old, empty the literal cache in every pertinent buffer.
(syntax-table): Add two (char table) extra slots: they hold lists of,
respectively, other syntax tables known to be (i) literally the same; (ii)
literally different from the current syntax table.
doc/emacs/programs.texi
src/chartab.c
src/lisp.h
src/syntax.c