Merge from emacs-23 branch
authorChong Yidong <cyd@stupidchicken.com>
Thu, 7 Jul 2011 16:18:25 +0000 (12:18 -0400)
committerChong Yidong <cyd@stupidchicken.com>
Thu, 7 Jul 2011 16:18:25 +0000 (12:18 -0400)
src/ChangeLog
src/composite.c
src/xdisp.c

index 6485ed0..9186061 100644 (file)
@@ -1,3 +1,10 @@
+2011-07-07  Kenichi Handa  <handa@m17n.org>
+
+       * composite.c (composition_compute_stop_pos): Ignore a static
+       composition starting before CHARPOS (Bug#8915).
+
+       * xdisp.c (handle_composition_prop): Likewise.
+
 2011-07-07  Eli Zaretskii  <eliz@gnu.org>
 
        * term.c (produce_glyphs) <xassert>: Allow IT_GLYPHLESS in it->what.
index 577640f..cf1e053 100644 (file)
@@ -1026,6 +1026,7 @@ composition_compute_stop_pos (struct composition_it *cmp_it, EMACS_INT charpos,
   /* FIXME: Bidi is not yet handled well in static composition.  */
   if (charpos < endpos
       && find_composition (charpos, endpos, &start, &end, &prop, string)
+      && start >= charpos
       && COMPOSITION_VALID_P (start, end, prop))
     {
       cmp_it->stop_pos = endpos = start;
index a99f06a..774bc22 100644 (file)
@@ -4583,6 +4583,11 @@ handle_composition_prop (struct it *it)
       && COMPOSITION_VALID_P (start, end, prop)
       && (STRINGP (it->string) || (PT <= start || PT >= end)))
     {
+      if (start < pos)
+       /* As we can't handle this situation (perhaps font-lock added
+          a new composition), we just return here hoping that next
+          redisplay will detect this composition much earlier.  */
+       return HANDLED_NORMALLY;
       if (start != pos)
        {
          if (STRINGP (it->string))