all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Robert J. Chassell" <bob@rattlesnake.com>
Cc: emacs-devel@gnu.org
Subject: Re: Scroll lock
Date: Wed, 22 Jun 2005 12:13:15 +0000 (UTC)	[thread overview]
Message-ID: <m1Dl46V-0004PWC@rattlesnake.com> (raw)
In-Reply-To: <d9a3rf$iiv$1@sea.gmane.org> (message from Ralf Angeli on Wed, 22 Jun 2005 00:26:39 +0200)

   in a German newsgroup somebody asked if it would be possible to keep
   the position of point fixed while doing vertical motion ...

Yes.  Here are defuns and keybindings to do this for arrow keys.
These go into a .emacs file.  Point stays fixed until it comes to the
top or bottom of a window; then it stays within the window.  I use
these keybindings very frequently both in read-write buffers and in
read-only buffers.



(defun scroll-forward-one-line ()
  "Scroll the text up one line.
A replacement for the three keystroke sequence
C-u 1 C-v."
  (interactive)
  (scroll-up 1))

(defun scroll-backward-one-line ()
  "Scroll the text down one line.
A replacement for the three keystroke sequence
C-u 1 M-v."
  (interactive)
  (scroll-down 1))

(global-set-key [down] 'scroll-forward-one-line)  ; Down arrow key
(global-set-key [up] 'scroll-backward-one-line)   ; Up arrow key



-- 
    Robert J. Chassell                         
    bob@rattlesnake.com                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc

  parent reply	other threads:[~2005-06-22 12:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21 22:26 Scroll lock Ralf Angeli
2005-06-22  3:41 ` Richard M. Stallman
2005-06-22  7:56   ` Ralf Angeli
2005-06-22 12:38     ` Juri Linkov
2005-06-22 13:38       ` Ralf Angeli
2005-06-23  0:54         ` Richard M. Stallman
2005-06-23  8:17           ` Ralf Angeli
2005-06-24  5:36             ` Richard M. Stallman
2005-06-26 21:38               ` Ralf Angeli
2005-06-23  0:54     ` Richard M. Stallman
2005-06-23  3:57       ` Miles Bader
2005-06-23  7:45       ` Ralf Angeli
2005-06-24  5:35         ` Richard M. Stallman
2005-06-26 21:38           ` Ralf Angeli
2005-06-27  5:37             ` Richard M. Stallman
2005-06-29 11:23               ` Ralf Angeli
2005-06-30  1:44                 ` Richard M. Stallman
2005-06-30  8:54                   ` Ralf Angeli
2005-06-30  9:32                     ` Miles Bader
2005-07-04 10:01                   ` Juanma Barranquero
2005-07-04 11:45                     ` Ralf Angeli
2005-07-04 13:25                       ` Juanma Barranquero
2005-06-22 12:13 ` Robert J. Chassell [this message]
2005-06-22 13:23 ` Thien-Thi Nguyen

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=m1Dl46V-0004PWC@rattlesnake.com \
    --to=bob@rattlesnake.com \
    --cc=emacs-devel@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.