Mercurial > hg > xemacs-beta
diff src/font-lock.c @ 70:131b0175ea99 r20-0b30
Import from CVS: tag r20-0b30
author | cvs |
---|---|
date | Mon, 13 Aug 2007 09:02:59 +0200 |
parents | 859a2309aef8 |
children | 3d6bfa290dbd |
line wrap: on
line diff
--- a/src/font-lock.c Mon Aug 13 09:00:04 2007 +0200 +++ b/src/font-lock.c Mon Aug 13 09:02:59 2007 +0200 @@ -414,6 +414,8 @@ find_context (struct buffer *buf, Bufpos pt) { /* This function can GC */ + struct Lisp_Char_Table *mirrortab = + XCHAR_TABLE (buf->mirror_syntax_table); Lisp_Object syntaxtab = buf->syntax_table; Emchar prev_c, c; Bufpos target = pt; @@ -470,7 +472,7 @@ continue; } - switch (SYNTAX (syntaxtab, c)) + switch (SYNTAX (mirrortab, c)) { case Sescape: context_cache.backslash_p = 1; @@ -491,13 +493,13 @@ { context_cache.context = context_comment; context_cache.ccontext = ccontext_none; - context_cache.style = SINGLE_SYNTAX_STYLE (syntaxtab, c); + context_cache.style = SINGLE_SYNTAX_STYLE (mirrortab, c); if (context_cache.style == comment_style_none) abort (); } break; case Sendcomment: - if (context_cache.style != SINGLE_SYNTAX_STYLE (syntaxtab, c)) + if (context_cache.style != SINGLE_SYNTAX_STYLE (mirrortab, c)) ; else if (context_cache.context == context_comment) { @@ -545,18 +547,18 @@ Now we've got to hack multi-char sequences that start and end block comments. */ - if ((SYNTAX_COMMENT_BITS (syntaxtab, c) & + if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_SECOND_CHAR_START) && context_cache.context == context_none && context_cache.ccontext == ccontext_start1 && - SYNTAX_START_P (syntaxtab, prev_c, c) /* the two chars match */ + SYNTAX_START_P (mirrortab, prev_c, c) /* the two chars match */ ) { context_cache.ccontext = ccontext_start2; - context_cache.style = SYNTAX_START_STYLE (syntaxtab, prev_c, c); + context_cache.style = SYNTAX_START_STYLE (mirrortab, prev_c, c); if (context_cache.style == comment_style_none) abort (); } - else if ((SYNTAX_COMMENT_BITS (syntaxtab, c) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_FIRST_CHAR_START) && context_cache.context == context_none && (context_cache.ccontext == ccontext_none || @@ -565,25 +567,25 @@ context_cache.ccontext = ccontext_start1; context_cache.style = comment_style_none; /* should be this already*/ } - else if ((SYNTAX_COMMENT_BITS (syntaxtab, c) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_SECOND_CHAR_END) && context_cache.context == context_block_comment && context_cache.ccontext == ccontext_end1 && - SYNTAX_END_P (syntaxtab, prev_c, c) && + SYNTAX_END_P (mirrortab, prev_c, c) && /* the two chars match */ context_cache.style == - SYNTAX_END_STYLE (syntaxtab, prev_c, c) + SYNTAX_END_STYLE (mirrortab, prev_c, c) ) { context_cache.context = context_none; context_cache.ccontext = ccontext_none; context_cache.style = comment_style_none; } - else if ((SYNTAX_COMMENT_BITS (syntaxtab, c) & + else if ((SYNTAX_COMMENT_BITS (mirrortab, c) & SYNTAX_FIRST_CHAR_END) && context_cache.context == context_block_comment && (context_cache.style == - SYNTAX_END_STYLE (syntaxtab, c, + SYNTAX_END_STYLE (mirrortab, c, BUF_FETCH_CHAR (buf, pt+1))) && (context_cache.ccontext == ccontext_start2 || context_cache.ccontext == ccontext_end1))