changeset 94200:8f5e7dfb15e8

(pos_visible_p): Check if iterator stops on a display string.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 20 Apr 2008 22:46:14 +0000
parents 4f5b6e367b16
children 18fdd5bece36
files src/xdisp.c
diffstat 1 files changed, 23 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/src/xdisp.c	Sun Apr 20 22:46:03 2008 +0000
+++ b/src/xdisp.c	Sun Apr 20 22:46:14 2008 +0000
@@ -1330,26 +1330,29 @@
 	  visible_p = 1;
       if (visible_p)
 	{
-	  Lisp_Object window, prop;
-
-	  XSETWINDOW (window, w);
-	  prop = Fget_char_property (make_number (it.position.charpos),
-				     Qinvisible, window);
-
-	  /* If charpos coincides with invisible text covered with an
-	     ellipsis, use the first glyph of the ellipsis to compute
-	     the pixel positions.  */
-	  if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2)
-	    {
-	      struct glyph_row *row = it.glyph_row;
-	      struct glyph *glyph = row->glyphs[TEXT_AREA];
-	      struct glyph *end = glyph + row->used[TEXT_AREA];
-	      int x = row->x;
-
-	      for (; glyph < end && glyph->charpos < charpos; glyph++)
-		x += glyph->pixel_width;
-
-	      top_x = x;
+	  if (it.method == GET_FROM_BUFFER)
+	    {
+	      Lisp_Object window, prop;
+
+	      XSETWINDOW (window, w);
+	      prop = Fget_char_property (make_number (it.position.charpos),
+					 Qinvisible, window);
+
+	      /* If charpos coincides with invisible text covered with an
+		 ellipsis, use the first glyph of the ellipsis to compute
+		 the pixel positions.  */
+	      if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2)
+		{
+		  struct glyph_row *row = it.glyph_row;
+		  struct glyph *glyph = row->glyphs[TEXT_AREA];
+		  struct glyph *end = glyph + row->used[TEXT_AREA];
+		  int x = row->x;
+
+		  for (; glyph < end && glyph->charpos < charpos; glyph++)
+		    x += glyph->pixel_width;
+
+		  top_x = x;
+		}
 	    }
 
 	  *x = top_x;