changeset 81419:ac14f6e0bfff

(update_compositions): Check the validness of compositions.
author Kenichi Handa <handa@m17n.org>
date Thu, 14 Jun 2007 12:33:41 +0000
parents 5ce347f4e5a9
children 5c330f38b4c5
files src/composite.c
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/composite.c	Thu Jun 14 12:12:23 2007 +0000
+++ b/src/composite.c	Thu Jun 14 12:33:41 2007 +0000
@@ -500,7 +500,8 @@
 	 avoid it, in such a case, we change the property of the
 	 latter to the copy of it.  */
       if (from > BEGV
-	  && find_composition (from - 1, -1, &start, &end, &prop, Qnil))
+	  && find_composition (from - 1, -1, &start, &end, &prop, Qnil)
+	  && COMPOSITION_VALID_P (start, end, prop))
 	{
 	  if (from < end)
 	    Fput_text_property (make_number (from), make_number (end),
@@ -510,7 +511,8 @@
 	  from = end;
 	}
       else if (from < ZV
-	       && find_composition (from, -1, &start, &from, &prop, Qnil))
+	       && find_composition (from, -1, &start, &from, &prop, Qnil)
+	       && COMPOSITION_VALID_P (start, end, prop))
 	run_composition_function (start, from, prop);
     }
 
@@ -521,6 +523,7 @@
          (to - 1).  */
       while (from < to - 1
 	     && find_composition (from, to, &start, &from, &prop, Qnil)
+	     && COMPOSITION_VALID_P (start, end, prop)
 	     && from < to - 1)
 	run_composition_function (start, from, prop);
     }
@@ -528,7 +531,8 @@
   if (check_mask & CHECK_TAIL)
     {
       if (from < to
-	  && find_composition (to - 1, -1, &start, &end, &prop, Qnil))
+	  && find_composition (to - 1, -1, &start, &end, &prop, Qnil)
+	  && COMPOSITION_VALID_P (start, end, prop))
 	{
 	  /* TO should be also at composition boundary.  But,
 	     insertion or deletion will make two compositions adjacent
@@ -542,7 +546,8 @@
 	  run_composition_function (start, end, prop);
 	}
       else if (to < ZV
-	       && find_composition (to, -1, &start, &end, &prop, Qnil))
+	       && find_composition (to, -1, &start, &end, &prop, Qnil)
+	       && COMPOSITION_VALID_P (start, end, prop))
 	run_composition_function (start, end, prop);
     }
 }