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: Valera Rozuvan
Subject: Re: Scrolling the screen vertically
Date: Wed, 4 Jul 2012 21:19:08 +0300

From: Eli Zaretskii
> Did you know about "C-x <" and "C-x >"?  If they don't do what you
> want, then please explain more.

Those commands are not exactly what I am looking for. I will try to
explain myself in detail.

Suppose you have a line that is 200 characters long. If you run the
command C-a, then the cursor moves to the beginning of the line, and
you are at column 0. If you run the command C-e, then the cursor moves
to the end of the line, and you are at column 199.

Now, suppose the screen is 80 columns wide (you have two windows open
side by side). If the cursor is positioned at column X, I want to be
able to do the following:

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.

Regards,
Valera Rozuvan



reply via email to

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