aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Monnier2001-05-01 13:49:44 +0000
committerStefan Monnier2001-05-01 13:49:44 +0000
commit423e705d9c36a723ca3fcc70db2417af4d200042 (patch)
tree18caf57d0b630737f44abcc983eed3026a1403f9
parent469fc0a23fd52eae6a754d2439acae358016bcd7 (diff)
downloademacs-423e705d9c36a723ca3fcc70db2417af4d200042.tar.gz
emacs-423e705d9c36a723ca3fcc70db2417af4d200042.zip
(update_syntax_table): Check that oldi has the same
properties as old_prop before deciding not to invalidate.
-rw-r--r--src/syntax.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 6202ef7842f..fb996de9dfa 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -162,7 +162,7 @@ update_syntax_table (charpos, count, init, object)
162 } 162 }
163 oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i; 163 oldi = i = count > 0 ? gl_state.forward_i : gl_state.backward_i;
164 164
165 /* We are guarantied to be called with CHARPOS either in i, 165 /* We are guaranteed to be called with CHARPOS either in i,
166 or further off. */ 166 or further off. */
167 if (NULL_INTERVAL_P (i)) 167 if (NULL_INTERVAL_P (i))
168 error ("Error in syntax_table logic for to-the-end intervals"); 168 error ("Error in syntax_table logic for to-the-end intervals");
@@ -172,21 +172,21 @@ update_syntax_table (charpos, count, init, object)
172 error ("Error in syntax_table logic for intervals <-"); 172 error ("Error in syntax_table logic for intervals <-");
173 /* Update the interval. */ 173 /* Update the interval. */
174 i = update_interval (i, charpos); 174 i = update_interval (i, charpos);
175 if (oldi->position != INTERVAL_LAST_POS (i)) 175 if (!gl_state.left_ok || oldi->position != INTERVAL_LAST_POS (i))
176 { 176 {
177 invalidate = 0; 177 invalidate = 0;
178 gl_state.right_ok = 1; /* Invalidate the other end. */ 178 gl_state.right_ok = 1; /* Invalidate the other end. */
179 gl_state.forward_i = i; 179 gl_state.forward_i = i;
180 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset; 180 gl_state.e_property = INTERVAL_LAST_POS (i) - gl_state.offset;
181 } 181 }
182 } 182 }
183 else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */ 183 else if (charpos >= INTERVAL_LAST_POS (i)) /* Move right. */
184 { 184 {
185 if (count < 0) 185 if (count < 0)
186 error ("Error in syntax_table logic for intervals ->"); 186 error ("Error in syntax_table logic for intervals ->");
187 /* Update the interval. */ 187 /* Update the interval. */
188 i = update_interval (i, charpos); 188 i = update_interval (i, charpos);
189 if (i->position != INTERVAL_LAST_POS (oldi)) 189 if (!gl_state.right_ok || i->position != INTERVAL_LAST_POS (oldi))
190 { 190 {
191 invalidate = 0; 191 invalidate = 0;
192 gl_state.left_ok = 1; /* Invalidate the other end. */ 192 gl_state.left_ok = 1; /* Invalidate the other end. */
@@ -206,9 +206,9 @@ update_syntax_table (charpos, count, init, object)
206 if (invalidate) 206 if (invalidate)
207 invalidate = !EQ (tmp_table, gl_state.old_prop); /* Need to invalidate? */ 207 invalidate = !EQ (tmp_table, gl_state.old_prop); /* Need to invalidate? */
208 208
209 if (invalidate) /* Did not get to adjacent interval. */ 209 if (invalidate) /* Did not get to adjacent interval. */
210 { /* with the same table => */ 210 { /* with the same table => */
211 /* invalidate the old range. */ 211 /* invalidate the old range. */
212 if (count > 0) 212 if (count > 0)
213 { 213 {
214 gl_state.backward_i = i; 214 gl_state.backward_i = i;