From: Valera Rozuvan <valera.rozuvan@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Scrolling the screen vertically
Date: Wed, 4 Jul 2012 21:19:08 +0300 [thread overview]
Message-ID: <CAM8kQFy5qbcsqxhhO+1EMjwy4=1BSy4xvk7rt50NdZ5OJy=37g@mail.gmail.com> (raw)
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
next reply other threads:[~2012-07-04 18:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-04 18:19 Valera Rozuvan [this message]
2012-07-04 20:20 ` Scrolling the screen vertically Eli Zaretskii
-- strict thread matches above, loose matches on Subject: below --
2012-07-06 15:38 Valera Rozuvan
2012-07-04 14:29 Valera Rozuvan
2012-07-04 15:34 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAM8kQFy5qbcsqxhhO+1EMjwy4=1BSy4xvk7rt50NdZ5OJy=37g@mail.gmail.com' \
--to=valera.rozuvan@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).