[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

28.12 Vertical Fractional Scrolling

Vertical fractional scrolling means shifting the image in the window up or down by a specified multiple or fraction of a line. Each window has a vertical scroll position, which is a number, never less than zero. It specifies how far to raise the contents of the window. Raising the window contents generally makes all or part of some lines disappear off the top, and all or part of some other lines appear at the bottom. The usual value is zero.

The vertical scroll position is measured in units of the normal line height, which is the height of the default font. Thus, if the value is .5, that means the window contents are scrolled up half the normal line height. If it is 3.3, that means the window contents are scrolled up somewhat over three times the normal line height.

What fraction of a line the vertical scrolling covers, or how many lines, depends on what the lines contain. A value of .5 could scroll a line whose height is very short off the screen, while a value of 3.3 could scroll just part of the way through a tall line or an image.

Function: window-vscroll &optional window pixels-p

This function returns the current vertical scroll position of window. If window is nil, the selected window is used. If pixels-p is non-nil, the return value is measured in pixels, rather than in units of the normal line height.

 
(window-vscroll)
     ⇒ 0
Function: set-window-vscroll window lines &optional pixels-p

This function sets window's vertical scroll position to lines. The argument lines should be zero or positive; if not, it is taken as zero.

If window is nil, the selected window is used.

The actual vertical scroll position must always correspond to an integral number of pixels, so the value you specify is rounded accordingly.

The return value is the result of this rounding.

 
(set-window-vscroll (selected-window) 1.2)
     ⇒ 1.13

If pixels-p is non-nil, lines specifies a number of pixels. In this case, the return value is lines.

Variable: auto-window-vscroll

If this variable is non-nil, the line-move, scroll-up, and scroll-down functions will automatically modify the window vscroll to scroll through display rows that are taller that the height of the window, for example in the presence of large images.


[ < ] [ > ]   [ << ] [Plus haut] [ >> ]         [Top] [Table des matières] [Index] [ ? ]

Ce document a été généré par Eric Reinbold le 13 Octobre 2007 en utilisant texi2html 1.78.