]> git.eshelyaron.com Git - emacs.git/commitdiff
(pos_visible_p): CHARPOS < 0 means return info for
authorKim F. Storm <storm@cua.dk>
Wed, 20 Sep 2006 09:43:18 +0000 (09:43 +0000)
committerKim F. Storm <storm@cua.dk>
Wed, 20 Sep 2006 09:43:18 +0000 (09:43 +0000)
last visible glyph in window.

src/xdisp.c

index 6efd095800233ac87bb0bf55d7c28043e4df35ef..c766f714335778540ae2bfcfaac1154514c2d817 100644 (file)
@@ -1275,6 +1275,7 @@ line_bottom_y (it)
 
 
 /* Return 1 if position CHARPOS is visible in window W.
+   CHARPOS < 0 means return info about WINDOW_END position.
    If visible, set *X and *Y to pixel coordinates of top left corner.
    Set *RTOP and *RBOT to pixel height of an invisible area of glyph at POS.
    Set *ROWH and *VPOS to row's visible height and VPOS (row number).  */
@@ -1313,10 +1314,10 @@ pos_visible_p (w, charpos, x, y, rtop, rbot, rowh, vpos)
 
   start_display (&it, w, top);
   move_it_to (&it, charpos, -1, it.last_visible_y-1, -1,
-             MOVE_TO_POS | MOVE_TO_Y);
+             (charpos >= 0 ? MOVE_TO_POS : 0) | MOVE_TO_Y);
 
   /* Note that we may overshoot because of invisible text.  */
-  if (IT_CHARPOS (it) >= charpos)
+  if (charpos >= 0 && IT_CHARPOS (it) >= charpos)
     {
       int top_x = it.current_x;
       int top_y = it.current_y;