changeset 5082:47a76678bf4d

(display_text_line): Pass new arg to compute_char_face and to Fnext_single_property_change.
author Richard M. Stallman <rms@gnu.org>
date Sat, 20 Nov 1993 09:42:16 +0000
parents 12a5a3e33209
children 37fecb3bf8d9
files src/xdisp.c
diffstat 1 files changed, 24 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sat Nov 20 08:42:47 1993 +0000
+++ b/src/xdisp.c	Sat Nov 20 09:42:16 1993 +0000
@@ -1730,7 +1730,6 @@
 #ifdef USE_TEXT_PROPERTIES
   /* The next location where the `invisible' property changes */
   int next_invisible;
-  Lisp_Object prop, position, endpos;
 #endif
   
   /* The face we're currently using.  */
@@ -1815,28 +1814,31 @@
 	  /* if the `invisible' property is set to t, we can skip to
 	     the next property change */
 	  while (pos == next_invisible && pos < end)
-	  {
-	    XFASTINT (position) = pos;
-	    prop = Fget_text_property (position,
-				       Qinvisible,
-				       Fcurrent_buffer ());
-	    endpos = Fnext_single_property_change (position,
-						   Qinvisible,
-						   Fcurrent_buffer ());
-	    if (INTEGERP (endpos))
-	      next_invisible = XINT (endpos);
-	    else
-	      next_invisible = end;
-	    if (! NILP (prop))
 	    {
-	      if (pos < point && next_invisible >= point)
-	      {
-		cursor_vpos = vpos;
-		cursor_hpos = p1 - startp;
-	      }
-	      pos = next_invisible;
+	      Lisp_Object position, limit, endpos, prop;
+	      XFASTINT (position) = pos;
+	      prop = Fget_text_property (position, Qinvisible,
+					 Fcurrent_buffer ());
+	      /* This is just an estimate to give reasonable
+		 performance; nothing should go wrong if it is too small.  */
+	      XFASTINT (limit) = pos + 50;
+	      endpos
+		= Fnext_single_property_change (position, Qinvisible,
+						Fcurrent_buffer (), limit);
+	      if (INTEGERP (endpos))
+		next_invisible = XINT (endpos);
+	      else
+		next_invisible = end;
+	      if (! NILP (prop))
+		{
+		  if (pos < point && next_invisible >= point)
+		    {
+		      cursor_vpos = vpos;
+		      cursor_hpos = p1 - startp;
+		    }
+		  pos = next_invisible;
+		}
 	    }
-	  }
 	  if (pos >= end)
 	    break;
 #endif
@@ -1848,7 +1850,7 @@
 	  if (pos >= next_face_change && FRAME_X_P (f))
 	    current_face = compute_char_face (f, w, pos,
 					      region_beg, region_end,
-					      &next_face_change);
+					      &next_face_change, pos + 50);
 #endif
 
 	  pause = end;