emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/composite.c,v


From: Kenichi Handa
Subject: [Emacs-diffs] Changes to emacs/src/composite.c,v
Date: Tue, 09 Sep 2008 11:07:49 +0000

CVSROOT:        /cvsroot/emacs
Module name:    emacs
Changes by:     Kenichi Handa <handa>   08/09/09 11:07:49

Index: composite.c
===================================================================
RCS file: /cvsroot/emacs/emacs/src/composite.c,v
retrieving revision 1.56
retrieving revision 1.57
diff -u -b -r1.56 -r1.57
--- composite.c 9 Sep 2008 02:06:39 -0000       1.56
+++ composite.c 9 Sep 2008 11:07:49 -0000       1.57
@@ -994,7 +994,11 @@
 {
   EMACS_INT start, end, c;
   Lisp_Object prop, val;
+  /* This is from forward_to_next_line_start in xdisp.c.  */
+  const int MAX_NEWLINE_DISTANCE = 500;
 
+  if (endpos > charpos + MAX_NEWLINE_DISTANCE)
+    endpos = charpos + MAX_NEWLINE_DISTANCE;
   cmp_it->stop_pos = endpos;
   if (find_composition (charpos, endpos, &start, &end, &prop, string)
       && COMPOSITION_VALID_P (start, end, prop))
@@ -1020,6 +1024,8 @@
        FETCH_STRING_CHAR_ADVANCE (c, string, charpos, bytepos);
       else
        FETCH_CHAR_ADVANCE (c, charpos, bytepos);
+      if (c == '\n')
+       break;
       val = CHAR_TABLE_REF (Vcomposition_function_table, c);
       if (! NILP (val))
        {
@@ -1041,6 +1047,11 @@
            }
        }
     }
+  if (charpos == endpos)
+    {
+      cmp_it->stop_pos = endpos;
+      cmp_it->ch = -2;
+    }
 }
 
 /* Check if the character at CHARPOS (and BYTEPOS) is composed
@@ -1062,6 +1073,13 @@
      struct face *face;
      Lisp_Object string;
 {
+  if (cmp_it->ch == -2)
+    {
+      composition_compute_stop_pos (cmp_it, charpos, bytepos, endpos, string);
+      if (cmp_it->ch == -2)
+       return 0;
+    }
+
   if (cmp_it->ch < 0)
     {
       /* We are looking at a static composition.  */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]