aboutsummaryrefslogtreecommitdiffstats
path: root/src/composite.c
diff options
context:
space:
mode:
authorChong Yidong2007-06-15 00:00:37 +0000
committerChong Yidong2007-06-15 00:00:37 +0000
commit4769f8c55596eb5f92e902dbfa822b3f607f114b (patch)
tree229f93f7b8f4de1486c26de546e52554471961d6 /src/composite.c
parent72918b615891bb382a575ef0fb302c7b659bd997 (diff)
downloademacs-4769f8c55596eb5f92e902dbfa822b3f607f114b.tar.gz
emacs-4769f8c55596eb5f92e902dbfa822b3f607f114b.zip
(update_compositions): Check validity of compositions.
Diffstat (limited to 'src/composite.c')
-rw-r--r--src/composite.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/composite.c b/src/composite.c
index 3e0606e9007..b0a5ebbc3ee 100644
--- a/src/composite.c
+++ b/src/composite.c
@@ -500,7 +500,8 @@ update_compositions (from, to, check_mask)
500 avoid it, in such a case, we change the property of the 500 avoid it, in such a case, we change the property of the
501 latter to the copy of it. */ 501 latter to the copy of it. */
502 if (from > BEGV 502 if (from > BEGV
503 && find_composition (from - 1, -1, &start, &end, &prop, Qnil)) 503 && find_composition (from - 1, -1, &start, &end, &prop, Qnil)
504 && COMPOSITION_VALID_P (start, end, prop))
504 { 505 {
505 if (from < end) 506 if (from < end)
506 Fput_text_property (make_number (from), make_number (end), 507 Fput_text_property (make_number (from), make_number (end),
@@ -510,7 +511,8 @@ update_compositions (from, to, check_mask)
510 from = end; 511 from = end;
511 } 512 }
512 else if (from < ZV 513 else if (from < ZV
513 && find_composition (from, -1, &start, &from, &prop, Qnil)) 514 && find_composition (from, -1, &start, &from, &prop, Qnil)
515 && COMPOSITION_VALID_P (start, from, prop))
514 run_composition_function (start, from, prop); 516 run_composition_function (start, from, prop);
515 } 517 }
516 518
@@ -521,6 +523,7 @@ update_compositions (from, to, check_mask)
521 (to - 1). */ 523 (to - 1). */
522 while (from < to - 1 524 while (from < to - 1
523 && find_composition (from, to, &start, &from, &prop, Qnil) 525 && find_composition (from, to, &start, &from, &prop, Qnil)
526 && COMPOSITION_VALID_P (start, from, prop)
524 && from < to - 1) 527 && from < to - 1)
525 run_composition_function (start, from, prop); 528 run_composition_function (start, from, prop);
526 } 529 }
@@ -528,7 +531,8 @@ update_compositions (from, to, check_mask)
528 if (check_mask & CHECK_TAIL) 531 if (check_mask & CHECK_TAIL)
529 { 532 {
530 if (from < to 533 if (from < to
531 && find_composition (to - 1, -1, &start, &end, &prop, Qnil)) 534 && find_composition (to - 1, -1, &start, &end, &prop, Qnil)
535 && COMPOSITION_VALID_P (start, end, prop))
532 { 536 {
533 /* TO should be also at composition boundary. But, 537 /* TO should be also at composition boundary. But,
534 insertion or deletion will make two compositions adjacent 538 insertion or deletion will make two compositions adjacent
@@ -542,7 +546,8 @@ update_compositions (from, to, check_mask)
542 run_composition_function (start, end, prop); 546 run_composition_function (start, end, prop);
543 } 547 }
544 else if (to < ZV 548 else if (to < ZV
545 && find_composition (to, -1, &start, &end, &prop, Qnil)) 549 && find_composition (to, -1, &start, &end, &prop, Qnil)
550 && COMPOSITION_VALID_P (start, end, prop))
546 run_composition_function (start, end, prop); 551 run_composition_function (start, end, prop);
547 } 552 }
548} 553}