]> git.eshelyaron.com Git - emacs.git/commitdiff
(pos_visible_p): Check if iterator stops on a display string.
authorChong Yidong <cyd@stupidchicken.com>
Sun, 20 Apr 2008 22:46:14 +0000 (22:46 +0000)
committerChong Yidong <cyd@stupidchicken.com>
Sun, 20 Apr 2008 22:46:14 +0000 (22:46 +0000)
src/xdisp.c

index 1f8b35a1d3af361e0a952fbdb8699362b7c0895f..50c115b42cae2742e34915e4c995bc3d1321ad0c 100644 (file)
@@ -1330,26 +1330,29 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
          visible_p = 1;
       if (visible_p)
        {
-         Lisp_Object window, prop;
+         if (it.method == GET_FROM_BUFFER)
+           {
+             Lisp_Object window, prop;
 
-         XSETWINDOW (window, w);
-         prop = Fget_char_property (make_number (it.position.charpos),
-                                    Qinvisible, window);
+             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;
+             /* 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;
+                 for (; glyph < end && glyph->charpos < charpos; glyph++)
+                   x += glyph->pixel_width;
 
-             top_x = x;
+                 top_x = x;
+               }
            }
 
          *x = top_x;