help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scrolling the screen vertically


From: Eli Zaretskii
Subject: Re: Scrolling the screen vertically
Date: Wed, 04 Jul 2012 23:20:43 +0300

> Date: Wed, 4 Jul 2012 21:19:08 +0300
> From: Valera Rozuvan <valera.rozuvan@gmail.com>
> 
> 1.) move to the column X + ((80 / 2) - 2) (scroll by half the screen's
> width to the right, with an overlap of 2 columns)
> 2.) move to the column X - ((80 / 2) - 2) (scroll by half the screen's
> width to the left, with an overlap of 2 columns)
> 3.) move the cursor to Y - 2, where Y is the right-most column visible
> on the screen
> 4.) move the cursor to Z + 2, where Z is the left-most column visible
> on the screen
> 
> Note that cases 1 and 3 are not the same, because the cursor can be
> positioned anywhere (for example X = Y - 2). Same with cases 2 and 4.
> 
> So I need functions to determine X, Y, Z, and the screen's width. Then
> I can write a function which will move the cursor forward and backward
> by a calculated number of characters.

Look at window-width and window-hscroll, I think they give you all you
need.  The functions to actually scroll are those bound to the keys I
mentioned, and you can control by how much to scroll by giving them an
argument (see their doc strings).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]