changeset 71431:ee60680fee73

(handle_composition_prop): Push iterator on stack. (set_iterator_to_next): Pop iterator at end of composition.
author Kim F. Storm <storm@cua.dk>
date Fri, 23 Jun 2006 11:50:36 +0000
parents 47574cbb5eb6
children 04d71fb0c6b3
files src/xdisp.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Fri Jun 23 11:50:08 2006 +0000
+++ b/src/xdisp.c	Fri Jun 23 11:50:36 2006 +0000
@@ -4487,6 +4487,8 @@
 		}
 	      return HANDLED_RECOMPUTE_PROPS;
 	    }
+
+	  push_it (it);
 	  it->method = GET_FROM_COMPOSITION;
 	  it->cmp_id = id;
 	  it->cmp_len = COMPOSITION_LENGTH (prop);
@@ -5791,19 +5793,19 @@
 
     case GET_FROM_COMPOSITION:
       xassert (it->cmp_id >= 0 && it->cmp_id < n_compositions);
-      if (STRINGP (it->string))
+      xassert (it->sp > 0);
+      pop_it (it);
+      if (it->method == GET_FROM_STRING)
 	{
 	  IT_STRING_BYTEPOS (*it) += it->len;
 	  IT_STRING_CHARPOS (*it) += it->cmp_len;
-	  it->method = GET_FROM_STRING;
 	  it->object = it->string;
 	  goto consider_string_end;
 	}
-      else
+      else if (it->method == GET_FROM_BUFFER)
 	{
 	  IT_BYTEPOS (*it) += it->len;
 	  IT_CHARPOS (*it) += it->cmp_len;
-	  it->method = GET_FROM_BUFFER;
 	  it->object = it->w->buffer;
 	}
       break;