comparison lispref/windows.texi @ 73017:5ac7f746930e

(Window Start): pos-visible-in-window-p allows specifying t for position to mean "end of window". Add window-line-height.
author Kim F. Storm <storm@cua.dk>
date Wed, 20 Sep 2006 10:14:19 +0000
parents 0a277f9db761
children 704341de9fc7
comparison
equal deleted inserted replaced
73016:a5bc9291e035 73017:5ac7f746930e
1353 view. Locations that are partially obscured are not considered 1353 view. Locations that are partially obscured are not considered
1354 visible unless @var{partially} is non-@code{nil}. The argument 1354 visible unless @var{partially} is non-@code{nil}. The argument
1355 @var{position} defaults to the current position of point in 1355 @var{position} defaults to the current position of point in
1356 @var{window}; @var{window}, to the selected window. 1356 @var{window}; @var{window}, to the selected window.
1357 1357
1358 If @var{position} is @code{t}, the last visible position in
1359 @var{window} is checked.
1360
1358 The @code{pos-visible-in-window-p} function considers only vertical 1361 The @code{pos-visible-in-window-p} function considers only vertical
1359 scrolling. If @var{position} is out of view only because @var{window} 1362 scrolling. If @var{position} is out of view only because @var{window}
1360 has been scrolled horizontally, @code{pos-visible-in-window-p} returns 1363 has been scrolled horizontally, @code{pos-visible-in-window-p} returns
1361 non-@code{nil} anyway. @xref{Horizontal Scrolling}. 1364 non-@code{nil} anyway. @xref{Horizontal Scrolling}.
1362 1365
1366 visible, it returns a list of the form @code{(@var{x} @var{y})}, where 1369 visible, it returns a list of the form @code{(@var{x} @var{y})}, where
1367 @var{x} and @var{y} are the pixel coordinates relative to the top left 1370 @var{x} and @var{y} are the pixel coordinates relative to the top left
1368 corner of the window; otherwise it returns an extended list of the 1371 corner of the window; otherwise it returns an extended list of the
1369 form @code{(@var{x} @var{y} @var{rtop} @var{rbot} @var{rowh} 1372 form @code{(@var{x} @var{y} @var{rtop} @var{rbot} @var{rowh}
1370 @var{vpos})}, where the @var{rtop} and @var{rbot} specify the number 1373 @var{vpos})}, where the @var{rtop} and @var{rbot} specify the number
1371 of invisible pixels at the top and bottom of the row at 1374 of off-window pixels at the top and bottom of the row at
1372 @var{position}, @var{rowh} specifies the visible height of that row, 1375 @var{position}, @var{rowh} specifies the visible height of that row,
1373 and @var{vpos} specifies the vertical position (zero-based row number) 1376 and @var{vpos} specifies the vertical position (zero-based row number)
1374 of that row. 1377 of that row.
1375 1378
1376 Here is an example: 1379 Here is an example:
1381 (or (pos-visible-in-window-p 1384 (or (pos-visible-in-window-p
1382 (point) (selected-window)) 1385 (point) (selected-window))
1383 (recenter 0)) 1386 (recenter 0))
1384 @end group 1387 @end group
1385 @end example 1388 @end example
1389 @end defun
1390
1391 @defun window-line-height &optional line window
1392 This function returns information about text line @var{line} in @var{window}.
1393 If @var{line} is one of @code{header-line} or @code{mode-line},
1394 @code{window-line-height} returns information about the corresponding
1395 line of the window. Otherwise, @var{line} is a text line number
1396 starting from 0. A negative number counts from the end of the window.
1397 The argument @var{line} defaults to the current line in @var{window};
1398 @var{window}, to the selected window.
1399
1400 If the display is not up-to-date, @code{window-line-height} returns
1401 @code{nil}. In that case, @code{pos-visible-in-window-p} may be used
1402 to obtain related information.
1403
1404 If there is no line corresponding to the specified @var{line},
1405 @code{window-line-height} returns @code{nil}. Otherwise, it returns
1406 a list @code{(@var{height} @var{vpos} @var{ypos} @var{offbot})},
1407 where @var{height} is the height in pixels of the visible part of the
1408 line, @var{vpos} and @var{ypos} are the vertical position in lines and
1409 pixels of the line relative to the top of the first text line, and
1410 @var{offbot} is the number of off-window pixels at the bottom of the
1411 text line. If there are off-window pixels at the top of the (first)
1412 text line, @var{ypos} is negative.
1386 @end defun 1413 @end defun
1387 1414
1388 @node Textual Scrolling 1415 @node Textual Scrolling
1389 @section Textual Scrolling 1416 @section Textual Scrolling
1390 @cindex textual scrolling 1417 @cindex textual scrolling