Mercurial > emacs
diff src/syntax.c @ 107366:14ff9accfbd3
Cleanup setup of gl_state in various parts of the code.
* syntax.h (SETUP_BUFFER_SYNTAX_TABLE): New macro.
(SETUP_SYNTAX_TABLE, SETUP_SYNTAX_TABLE_FOR_OBJECT):
* syntax.c (find_defun_start, Fchar_syntax, Fmatching_paren, skip_chars):
* regex.c (regex_compile): Use it.
(re_compile_pattern): Don't set gl_state.current_syntax_table since
it's now set in regex_compile when/if we need it.
| author | Stefan Monnier <monnier@iro.umontreal.ca> |
|---|---|
| date | Wed, 10 Mar 2010 09:45:21 -0500 |
| parents | 230cb6c59526 |
| children | ea6ba19c6edd |
line wrap: on
line diff
--- a/src/syntax.c Wed Mar 10 23:16:06 2010 +0900 +++ b/src/syntax.c Wed Mar 10 09:45:21 2010 -0500 @@ -385,8 +385,7 @@ /* We optimize syntax-table lookup for rare updates. Thus we accept only those `^\s(' which are good in global _and_ text-property syntax-tables. */ - gl_state.current_syntax_table = current_buffer->syntax_table; - gl_state.use_global = 0; + SETUP_BUFFER_SYNTAX_TABLE (); while (PT > BEGV) { int c; @@ -401,8 +400,7 @@ if (SYNTAX (c) == Sopen) break; /* Now fallback to the default value. */ - gl_state.current_syntax_table = current_buffer->syntax_table; - gl_state.use_global = 0; + SETUP_BUFFER_SYNTAX_TABLE (); } /* Move to beg of previous line. */ scan_newline (PT, PT_BYTE, BEGV, BEGV_BYTE, -2, 1); @@ -860,11 +858,9 @@ Lisp_Object character; { int char_int; - gl_state.current_syntax_table = current_buffer->syntax_table; - - gl_state.use_global = 0; CHECK_NUMBER (character); char_int = XINT (character); + SETUP_BUFFER_SYNTAX_TABLE (); return make_number (syntax_code_spec[(int) SYNTAX (char_int)]); } @@ -874,10 +870,9 @@ Lisp_Object character; { int char_int, code; - gl_state.current_syntax_table = current_buffer->syntax_table; - gl_state.use_global = 0; CHECK_NUMBER (character); char_int = XINT (character); + SETUP_BUFFER_SYNTAX_TABLE (); code = SYNTAX (char_int); if (code == Sopen || code == Sclose) return SYNTAX_MATCH (char_int); @@ -1752,7 +1747,7 @@ let's initialize it manually. We ignore syntax-table text-properties for now, since that's what we've done in the past. */ - SETUP_SYNTAX_TABLE (BEGV, 0); + SETUP_BUFFER_SYNTAX_TABLE (); if (forwardp) { if (multibyte)
