aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-04-20 22:46:14 +0000
committerChong Yidong2008-04-20 22:46:14 +0000
commit67643d4b8618268d7fe3f838ae84cbfad06a797f (patch)
tree3d372cfa29a2e8e120b8568493063e7b6f40949e
parenta32b2382dacdcd0001e83129d79e39e9d19513de (diff)
downloademacs-67643d4b8618268d7fe3f838ae84cbfad06a797f.tar.gz
emacs-67643d4b8618268d7fe3f838ae84cbfad06a797f.zip
(pos_visible_p): Check if iterator stops on a display string.
-rw-r--r--src/xdisp.c35
1 files changed, 19 insertions, 16 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index 1f8b35a1d3a..50c115b42ca 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1330,26 +1330,29 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
1330 visible_p = 1; 1330 visible_p = 1;
1331 if (visible_p) 1331 if (visible_p)
1332 { 1332 {
1333 Lisp_Object window, prop; 1333 if (it.method == GET_FROM_BUFFER)
1334 {
1335 Lisp_Object window, prop;
1334 1336
1335 XSETWINDOW (window, w); 1337 XSETWINDOW (window, w);
1336 prop = Fget_char_property (make_number (it.position.charpos), 1338 prop = Fget_char_property (make_number (it.position.charpos),
1337 Qinvisible, window); 1339 Qinvisible, window);
1338 1340
1339 /* If charpos coincides with invisible text covered with an 1341 /* If charpos coincides with invisible text covered with an
1340 ellipsis, use the first glyph of the ellipsis to compute 1342 ellipsis, use the first glyph of the ellipsis to compute
1341 the pixel positions. */ 1343 the pixel positions. */
1342 if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2) 1344 if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2)
1343 { 1345 {
1344 struct glyph_row *row = it.glyph_row; 1346 struct glyph_row *row = it.glyph_row;
1345 struct glyph *glyph = row->glyphs[TEXT_AREA]; 1347 struct glyph *glyph = row->glyphs[TEXT_AREA];
1346 struct glyph *end = glyph + row->used[TEXT_AREA]; 1348 struct glyph *end = glyph + row->used[TEXT_AREA];
1347 int x = row->x; 1349 int x = row->x;
1348 1350
1349 for (; glyph < end && glyph->charpos < charpos; glyph++) 1351 for (; glyph < end && glyph->charpos < charpos; glyph++)
1350 x += glyph->pixel_width; 1352 x += glyph->pixel_width;
1351 1353
1352 top_x = x; 1354 top_x = x;
1355 }
1353 } 1356 }
1354 1357
1355 *x = top_x; 1358 *x = top_x;