all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Yevgeniy Makarov <emakarov@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: How to scroll while keeping the position of the point with respect to the text?
Date: Wed, 05 Sep 2007 19:49:48 -0000	[thread overview]
Message-ID: <1189021788.363162.152960@19g2000hsx.googlegroups.com> (raw)
In-Reply-To: <ubqcglxf9.fsf@computer.org>

> (global-set-key [M-up]
>  (lambda() (interactive) (scroll-down 1) (previous-line 1)))
> (global-set-key [M-down]
>  (lambda() (interactive) (scroll-up 1) (next-line 1)))
> (global-set-key [S-up]
>  (lambda() (interactive) (scroll-up 1)))
> (global-set-key [S-down]
>  (lambda() (interactive) (scroll-down 1)))
>
> in my .emacs. Thus I could use Shift-up/down to scroll and keep the
> position of the point wrt the text (Ithink that was what you were
> looking for) or use M-up/down to scroll the text underneath the point.

I am sorry, something does not fit here. Your Shift-up does scroll-up,
which does change the position of the cursor. Second, "(scroll-down 1)
(previous-line 1)" moves the point *two* lines w.r.t. the text. You
probably meant "(scroll-down 1) (next-line 1)". Finally, the problem
with this is that the point is moved to the beginning of the line. And
preserving the horizontal position is not easy, because if some line
is shorter but the following one is long, I'd like for the point to
keep the horizontal position. This calls for watching for the unbroken
series of scrolling commands.

  reply	other threads:[~2007-09-05 19:49 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-05 19:08 How to scroll while keeping the position of the point with respect to the text? Yevgeniy Makarov
2007-09-05 19:33 ` Ekkehard Görlach
2007-09-05 19:49   ` Yevgeniy Makarov [this message]
2007-09-05 20:38 ` Ph. Ivaldi
2007-09-05 21:42 ` Peter Dyballa
2007-09-06 11:34   ` Yevgeniy Makarov

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1189021788.363162.152960@19g2000hsx.googlegroups.com \
    --to=emakarov@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.