From: Chris McMahan <first_initiallastname@one.dot.net>
To: help-gnu-emacs@gnu.org
Subject: Re: How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi)
Date: Fri, 03 Oct 2008 16:07:24 -0400 [thread overview]
Message-ID: <7sk5cph283.fsf@one.dot.net> (raw)
In-Reply-To: mailman.153.1223050175.25473.help-gnu-emacs@gnu.org
Paul R <paul.r.ml@gmail.com> writes:
> Chris> If that's not what you have in mind, I've been using these for
> Chris> some time. They keep the cursor in place and move the text
> Chris> underneath it.
>
> Chris> (defun scroll-down-in-place (n) (interactive "p")
> Chris> (previous-line n) (scroll-down n))
>
> Chris> (defun scroll-up-in-place (n) (interactive "p") (next-line n)
> Chris> (scroll-up n))
>
> To avoid weird behaviour when seeing ends of your buffer, use the code
> below.
>
> (global-set-key [down] (lambda ()
> (interactive)
> (next-line 1)
> (unless (eq (window-end) (point-max))
> (scroll-up 1))))
> (global-set-key [up] (lambda ()
> (interactive)
> (previous-line 1)
> (unless (eq (window-start) (point-min))
> (scroll-down 1))))
Excellent! Thank you!
BTW, where can I get info on the key syntax you're using? [down] and
[up]...
- Chris
--
(. .)
=ooO=(_)=Ooo=====================================
Chris McMahan | first_initiallastname@one.dot.net
=================================================
next prev parent reply other threads:[~2008-10-03 20:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.142.1223043676.25473.help-gnu-emacs@gnu.org>
2008-10-03 15:31 ` How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi) Chris McMahan
2008-10-03 16:09 ` Paul R
2008-10-03 19:57 ` How do you create a "cscope buffer window" in ecb ? - very useful Sanjeev Kumar.S
[not found] ` <mailman.153.1223050175.25473.help-gnu-emacs@gnu.org>
2008-10-03 20:07 ` Chris McMahan [this message]
2008-10-04 0:57 ` How do you scroll the screen without moving the cursor ? (theC-E and C-Y keys in vi) David Lam
2008-10-04 9:03 ` Paul R
2008-10-04 21:24 ` Livin Stephen
2008-10-03 6:42 How do you scroll the screen without moving the cursor ? (the C-E " zoltan
2008-10-03 14:20 ` How do you scroll the screen without moving the cursor ? (theC-E " Parker, Matthew
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=7sk5cph283.fsf@one.dot.net \
--to=first_initiallastname@one.dot.net \
--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.