summaryrefslogtreecommitdiff
path: root/src/syntax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/syntax.c')
-rw-r--r--src/syntax.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 480fa6de82a..2043cff63d6 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1,5 +1,6 @@
/* GNU Emacs routines to deal with syntax tables; also word and list parsing.
- Copyright (C) 1985, 87, 93, 94, 95, 97, 1998, 1999, 2004 Free Software Foundation, Inc.
+ Copyright (C) 1985, 1987, 1993, 1994, 1995, 1997, 1998, 1999, 2002,
+ 2003, 2004, 2005 Free Software Foundation, Inc.
This file is part of GNU Emacs.
@@ -132,7 +133,7 @@ update_syntax_table (charpos, count, init, object)
{
Lisp_Object tmp_table;
int cnt = 0, invalidate = 1;
- INTERVAL i, oldi;
+ INTERVAL i;
if (init)
{
@@ -163,7 +164,7 @@ update_syntax_table (charpos, count, init, object)
gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
goto update;
}
- oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i;
+ i = count > 0 ? gl_state.forward_i : gl_state.backward_i;
/* We are guaranteed to be called with CHARPOS either in i,
or further off. */
@@ -248,7 +249,8 @@ update_syntax_table (charpos, count, init, object)
}
else
{
- gl_state.b_property = i->position + LENGTH (i) - gl_state.offset;
+ gl_state.b_property
+ = i->position + LENGTH (i) - gl_state.offset;
gl_state.backward_i = i;
}
return;
@@ -257,7 +259,12 @@ update_syntax_table (charpos, count, init, object)
{
if (count > 0)
{
- gl_state.e_property = i->position + LENGTH (i) - gl_state.offset;
+ gl_state.e_property
+ = i->position + LENGTH (i) - gl_state.offset
+ /* e_property at EOB is not set to ZV but to ZV+1, so that
+ we can do INC(from);UPDATE_SYNTAX_TABLE_FORWARD without
+ having to check eob between the two. */
+ + (NULL_INTERVAL_P (next_interval (i)) ? 1 : 0);
gl_state.forward_i = i;
}
else
@@ -3168,6 +3175,14 @@ syms_of_syntax ()
staticpro (&Vsyntax_code_object);
+ staticpro (&gl_state.object);
+ staticpro (&gl_state.global_code);
+ staticpro (&gl_state.current_syntax_table);
+ staticpro (&gl_state.old_prop);
+
+ /* Defined in regex.c */
+ staticpro (&re_match_object);
+
Qscan_error = intern ("scan-error");
staticpro (&Qscan_error);
Fput (Qscan_error, Qerror_conditions,