# scroll-left(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

scroll-left - Move the window left (scrolling)
scroll-right - Move the window right (scrolling)

## SYNOPSIS

n scroll-left (C-x <)
n scroll-right (C-x >)

## DESCRIPTION

scroll-left moves the window in current buffer left by 1 screen width. If an argument n is supplied then the resolution of movement is specified in characters relative to the current displacement. Moving the window in the current buffer left by n characters (that is if the current left-hand margin of the screen is column 0, the left hand margin becomes column n).

scroll-right moves the window in current buffer right by 1 screen width. If an argument n is supplied then the resolution of movement is specified in characters relative to the current displacement.

The ends of the lines of a scrolled screen are delimited with a dollar ($) character indicating that the text continues. When no scroll is in effect the left hand margin of the screen does not show the $ symbol. i.e. The line `This text is scrolled on this line` with a current scroll offset of 2 in a 22 column window would appear as follows:

             22
    |<------------------->|

    |$s text is scrolled $|

The amount of scroll (n) is effectively unlimited, it is possible to scroll all of the text in a buffer out of the window, when only $'s appear in the left margin, in the last highlighting color of the line (blank lines always remain blank and are not delimited with a $). Text on the current line is handled according to the value of $scroll(5) as follows:

$scroll 0

The current line ONLY is scrolled (about the current scroll position) to enable the current buffers cursor position to be viewed. To enable the user to determine where the current line is in relation to the scrolled lines then the first character of the current line is interpreted as follows:-

All of user text appears

    |$f line of te$|
    |At start of l$|
    |$f line of te$|

Surrounding lines commence with "$" indicates at the start of the line.

$ in column 0

    |$f line of te$|
    |$f line of te$|
    |$f line of te$|

Text column is the same as the surrounding text i.e. the line and window scroll are the same.

> Left of scroll position

    |$f line of te$|
    |>f line of te$|
    |$f line of te$|

The current line is to the left of the scrolled position. forward-char (i.e. interpret as `-->` indicating the direction of travel) moves the cursor, and therefore the line, towards the natural scroll position ($ in column).

< Right of scroll position

    |$f line of te$|
    |<f line of te$|
    |$f line of te$|

The current line is to the right of the scrolled position. backward-char (i.e. interpret as `<--` indicating the direction of travel) moves the cursor, and therefore the line, towards the natural scroll position ($ in column).

$scroll 1

The position of the cursor on the line determines the scrolled position. In this case all lines in the window are scrolled to ensure that the cursor is always visible. This mode is only useful when dealing with large blocks of text whose line lengths do not vary.

## NOTES

The scrolling is an attribute of the WINDOW and not the BUFFER. If the window is closed, or contents swapped to a different buffer then the scroll setting is reset for the next buffer. A return to the previous buffer does not restore the scroll setting. The only case where scrolling is inherited is when a window is split (see split-window-vertically(2)).

When binding scroll-left to the keyboard then it is important to note that when no argument is specified the resolution is frame-width's. A key binding would operate on character multiples, hence the command should be bound with a numeric argument to perform the perform the keyboard action. e.g.

    1 global-bind-key scroll-left  "A-left"
    1 global-bind-key scroll-right "A-right"

To move 5 columns on a key stroke, for an accelerated scroll, then the binding may be re-written as:-

    5 global-bind-key scroll-left  "A-left"
    5 global-bind-key scroll-right "A-right"

## SEE ALSO

$scroll(5), scroll-up(2), scroll-down(2), $window-x-scroll(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>