From: Chong Yidong Date: Sat, 26 Jan 2008 01:00:44 +0000 (+0000) Subject: (pos_visible_p): Handle the case where charpos falls on X-Git-Tag: emacs-pretest-23.0.90~8400 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=a5bafa401fc141892429a27ae18d46e8dde84446;p=emacs.git (pos_visible_p): Handle the case where charpos falls on invisible text covered with an ellipsis. --- diff --git a/src/xdisp.c b/src/xdisp.c index 8c1b2b945fe..d8619cdfa9e 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1321,6 +1321,28 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos) 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; + } + *x = top_x; *y = max (top_y + max (0, it.max_ascent - it.ascent), window_top_y); *rtop = max (0, window_top_y - top_y);