From: Eli Zaretskii Date: Sat, 5 Jul 2014 07:38:13 +0000 (+0300) Subject: Fix bug #17942 with pos-visible-in-window-p and image and BOB. X-Git-Tag: emacs-24.3.93~93 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=bf97132f839ca4717ffd173c7aa80d48feb254d5;p=emacs.git Fix bug #17942 with pos-visible-in-window-p and image and BOB. src/xdisp.c (pos_visible_p): If CHARPOS is at BEGV, and there is a display property at BEGV, don't call move_it_to to move to a position before BEGV. --- diff --git a/src/ChangeLog b/src/ChangeLog index 6048522cdc4..dde148dc165 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2014-07-05 Eli Zaretskii + + * xdisp.c (pos_visible_p): If CHARPOS is at BEGV, and there is a + display property at BEGV, don't call move_it_to to move to a + position before BEGV. (Bug#17942) + 2014-07-05 Stefan Monnier * syntax.c (find_defun_start): Try the cache even diff --git a/src/xdisp.c b/src/xdisp.c index fe5d0f579d8..f5ddf828314 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -1585,7 +1585,8 @@ pos_visible_p (struct window *w, ptrdiff_t charpos, int *x, int *y, /* Move to the last buffer position before the display property. */ start_display (&it3, w, top); - move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); + if (start > BEGV) + move_it_to (&it3, start - 1, -1, -1, -1, MOVE_TO_POS); /* Move forward one more line if the position before the display string is a newline or if it is the rightmost character on a line that is