summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2010-03-10 09:45:21 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2010-03-10 09:45:21 -0500
commitd48cd3f48fdd0d67f906311b632fb58ae4765b5e (patch)
tree01c407576bb4aa2e07765a0314a58d2344960fce /src/syntax.c
parent61c264722eabe920e3fadf892eb9d2e1c84d1ae3 (diff)
downloademacs-d48cd3f48fdd0d67f906311b632fb58ae4765b5e.tar.gz
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.
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 47b4caf5ade..a80f047e43c 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -385,8 +385,7 @@ find_defun_start (pos, pos_byte)
/* 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 @@ find_defun_start (pos, pos_byte)
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 @@ are listed in the documentation of `modify-syntax-entry'. */)
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 @@ DEFUN ("matching-paren", Fmatching_paren, Smatching_paren, 1, 1, 0,
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 @@ skip_chars (forwardp, string, lim, handle_iso_classes)
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)