aboutsummaryrefslogtreecommitdiffstats
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 1dcb3a5d15d..2acbd413858 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -519,8 +519,7 @@ update_syntax_table_forward (ptrdiff_t charpos, bool init,
519 else 519 else
520 { 520 {
521 update_syntax_table (charpos, 1, init, object); 521 update_syntax_table (charpos, 1, init, object);
522 if (gl_state.e_property > syntax_propertize__done 522 if (NILP (object) && gl_state.e_property > syntax_propertize__done)
523 && NILP (object))
524 parse_sexp_propertize (charpos); 523 parse_sexp_propertize (charpos);
525 } 524 }
526} 525}
@@ -791,8 +790,10 @@ back_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
791 || SYNTAX_FLAGS_COMMENT_NESTED (syntax) != comnested)) 790 || SYNTAX_FLAGS_COMMENT_NESTED (syntax) != comnested))
792 continue; 791 continue;
793 792
794 /* Ignore escaped characters, except comment-enders. */ 793 /* Ignore escaped characters, except comment-enders which cannot
795 if (code != Sendcomment && char_quoted (from, from_byte)) 794 be escaped. */
795 if ((Vcomment_end_can_be_escaped || code != Sendcomment)
796 && char_quoted (from, from_byte))
796 continue; 797 continue;
797 798
798 switch (code) 799 switch (code)
@@ -2347,7 +2348,8 @@ forw_comment (ptrdiff_t from, ptrdiff_t from_byte, ptrdiff_t stop,
2347 if (code == Sendcomment 2348 if (code == Sendcomment
2348 && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style 2349 && SYNTAX_FLAGS_COMMENT_STYLE (syntax, 0) == style
2349 && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ? 2350 && (SYNTAX_FLAGS_COMMENT_NESTED (syntax) ?
2350 (nesting > 0 && --nesting == 0) : nesting < 0)) 2351 (nesting > 0 && --nesting == 0) : nesting < 0)
2352 && !(Vcomment_end_can_be_escaped && char_quoted (from, from_byte)))
2351 /* We have encountered a comment end of the same style 2353 /* We have encountered a comment end of the same style
2352 as the comment sequence which began this comment 2354 as the comment sequence which began this comment
2353 section. */ 2355 section. */
@@ -3703,6 +3705,12 @@ character of that word.
3703In both cases, LIMIT bounds the search. */); 3705In both cases, LIMIT bounds the search. */);
3704 Vfind_word_boundary_function_table = Fmake_char_table (Qnil, Qnil); 3706 Vfind_word_boundary_function_table = Fmake_char_table (Qnil, Qnil);
3705 3707
3708 DEFVAR_BOOL ("comment-end-can-be-escaped", Vcomment_end_can_be_escaped,
3709 doc: /* Non-nil means an escaped ender inside a comment doesn'tend the comment. */);
3710 Vcomment_end_can_be_escaped = 0;
3711 DEFSYM (Qcomment_end_can_be_escaped, "comment-end-can-be-escaped");
3712 Fmake_variable_buffer_local (Qcomment_end_can_be_escaped);
3713
3706 defsubr (&Ssyntax_table_p); 3714 defsubr (&Ssyntax_table_p);
3707 defsubr (&Ssyntax_table); 3715 defsubr (&Ssyntax_table);
3708 defsubr (&Sstandard_syntax_table); 3716 defsubr (&Sstandard_syntax_table);