emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Scroll lock


From: Robert J. Chassell
Subject: Re: Scroll lock
Date: Wed, 22 Jun 2005 12:13:15 +0000 (UTC)

   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                         
    address@hidden                         GnuPG Key ID: 004B4AC8
    http://www.rattlesnake.com                  http://www.teak.cc




reply via email to

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