changeset 73013:6ebbc42247b3

(Fset_window_hscroll, Fpos_visible_in_window_p): Doc fix. Use "off-window" instead of "off-screen". (Fpos_visible_in_window_p): Likewise. If POS is t, return info for last visible glyph in window.
author Kim F. Storm <storm@cua.dk>
date Wed, 20 Sep 2006 09:43:25 +0000
parents ec1038b88e4e
children c44b9d4a6bf6
files src/window.c
diffstat 1 files changed, 10 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/window.c	Wed Sep 20 09:43:18 2006 +0000
+++ b/src/window.c	Wed Sep 20 09:43:25 2006 +0000
@@ -333,6 +333,7 @@
 If a character is only partially visible, nil is returned, unless the
 optional argument PARTIALLY is non-nil.
 If POS is only out of view because of horizontal scrolling, return non-nil.
+If POS is t, it specifies the position of the last visible glyph in WINDOW.
 POS defaults to point in WINDOW; WINDOW defaults to the selected window.
 
 If POS is visible, return t if PARTIALLY is nil; if PARTIALLY is non-nil,
@@ -340,7 +341,7 @@
 where X and Y are the pixel coordinates relative to the top left corner
 of the window.  The remaining elements are omitted if the character after
 POS is fully visible; otherwise, RTOP and RBOT are the number of pixels
-off-screen at the top and bottom of the row, ROWH is the height of the
+off-window at the top and bottom of the row, ROWH is the height of the
 display row, and VPOS is the row number (0-based) containing POS.  */)
      (pos, window, partially)
      Lisp_Object pos, window, partially;
@@ -357,7 +358,9 @@
   buf = XBUFFER (w->buffer);
   SET_TEXT_POS_FROM_MARKER (top, w->start);
 
-  if (!NILP (pos))
+  if (EQ (pos, Qt))
+    posint = -1;
+  else if (!NILP (pos))
     {
       CHECK_NUMBER_COERCE_MARKER (pos);
       posint = XINT (pos);
@@ -369,8 +372,8 @@
 
   /* If position is above window start or outside buffer boundaries,
      or if window start is out of range, position is not visible.  */
-  if (posint >= CHARPOS (top)
-      && posint <= BUF_ZV (buf)
+  if ((EQ (pos, Qt)
+       || (posint >= CHARPOS (top) && posint <= BUF_ZV (buf)))
       && CHARPOS (top) >= BUF_BEGV (buf)
       && CHARPOS (top) <= BUF_ZV (buf)
       && pos_visible_p (w, posint, &x, &y, &rtop, &rbot, &rowh, &vpos)
@@ -403,8 +406,8 @@
 Value is a list (HEIGHT VPOS YPOS OFFBOT), where HEIGHT is the height
 in pixels of the visible part of the line, VPOS and YPOS are the
 vertical position in lines and pixels of the row, relative to the top
-of the first text line, and OFFBOT is the number of off-screen pixels at
-the bottom of the text row.  If there are off-screen pixels at the top
+of the first text line, and OFFBOT is the number of off-window pixels at
+the bottom of the text row.  If there are off-window pixels at the top
 of the (first) text row, YPOS is negative.
 
 Return nil if window display is not up-to-date.  In that case, use
@@ -565,7 +568,7 @@
 Return NCOL.  NCOL should be zero or positive.
 
 Note that if `automatic-hscrolling' is non-nil, you cannot scroll the
-window so that the location of point moves off-screen.  */)
+window so that the location of point moves off-window.  */)
      (window, ncol)
      Lisp_Object window, ncol;
 {