$window-x-sroll - Current window X scroll
$window-xcl-sroll - Current window current line X scroll
$window-y-sroll - Current window Y scroll
$window-x-sroll integer
$window-xcl-sroll integer
0 <= integer <= 65535
$window-y-sroll integer
0 <= integer <= n
$window-x-sroll defines the horizontal scroll position in the current window for all lines except the current line, $window-xcl-sroll defines the scroll position for the current line. The variables set how many characters are scrolled off the left hand edge of the current window, the variables are indirectly set by commands such as scroll-left(2), forward-char(2) etc.
$window-y-sroll defines the vertical scroll position in the current window. It sets the number of lines are scroll up off the top of the current window, it is indirectly set by commands such as scroll-up(2), forward-line(2) etc.
The following example first stores the current window's buffer position and the window layout. The middle '...' section could be replaced with macro code performing any number of operations before the last section which restores the initial position:
set-variable #l0 $window-line set-variable #l1 $window-col set-variable #l2 $window-xcl-scroll set-variable #l3 $window-x-scroll set-variable #l4 $window-y-scroll . . . set-variable $window-line #l0 set-variable $window-col #l1 set-variable $window-xcl-scroll #l2 set-variable $window-x-scroll #l3 set-variable $window-y-scroll #l4
If these variables are set by the user or a macro the value is validated against the $scroll(5) method and the current cursor position which may lead to the variable being reset if found to be invalid. For example, if the current line is 10 when the $window-y-scroll is set to 20 the variable will be reset to 0 as a value of 20 will mean the current line is not displayed in the current window.
Copyright (c) 1998-2006 JASSPA
Last Modified: 2002/01/11
Generated On: 2006/10/07