help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: scrolling


From: upro
Subject: Re: scrolling
Date: Fri, 08 Aug 2003 09:34:16 +0200
User-agent: Gnus/5.1001 (Gnus v5.10.1) Emacs/21.3 (gnu/linux)

schaecsn <address@hidden> writes:

> Hi,
>
> 1) Let's assume the cursor is somewhere in the middle of the
> screen. How can I scroll the screen by 1 line up or down?
>
> 2) If I'm at the bottom of the screen and I press cursor-down then the
> screen scrolls by several lines. Google told me to set scroll-step to
> 1.
>
> (setq scroll-step 1)
>
> That works several times but then the cursor is suddenly in the middle
> of the screen. I don't like that.
>
>
> Thanks for any help :)

Hi!

I had the ame problem and didn't like the scroll behavior. 

I found scroll-in-place.el, which I bound to shift-cursor keys. When I
use it the cursor stays in place and the bzuffer content moves.

You should be able to find the code here:
http://www.on.ics.keio.ac.jp/~yasu/linux/scroll-in-place.el or
somewhere else on google. If not I can mail it to you or post it on
gnu.emacs.sources


I added the following lines to my .emacs:

;; Scrolls one line at the time
(setq scroll-step 1)

;; Better scrolling...
(require 'scroll-in-place)
;; By default, this package provides for the standard GNU Emacs vertical
;; scrolling commands (`scroll-down', `scroll-up', `scroll-other-window-
;; down', and `scroll-other-window') to use the "in place" features.  If you
;; would rather not have this, set the variable `scroll-in-place' to `nil':

(setq scroll-in-place nil)

;; When `scroll-in-place' is `nil' you will have to bind keys in order to
;; call the "in place" scrolling commands.  For example, you might want to do
;; the following:

(setq scroll-command-groups
      (list '(scroll-down-one-line scroll-up-one-line)))

;;; You could write the `scroll-down-one-line' command like this:

(defun scroll-down-one-line (arg)
  "Scroll down one line, or number of lines specified by prefix arg."
  (interactive "P")
  (let ((scroll-default-lines 1))
    (scroll-down-in-place arg)))
(defun scroll-up-one-line (arg)
  "Scroll down one line, or number of lines specified by prefix arg."
  (interactive "P")
  (let ((scroll-default-lines 1))
    (scroll-up-in-place arg)))

;; key bindings
(global-set-key  [(shift up)] 'scroll-down-one-line)
(global-set-key [(shift down)] 'scroll-up-one-line)


HTH, best

-- 
Michael

r-znvy: zvpunry.wryqra  jro.qr (chg gur "@" jurer vg svgf...)
ab fcnz cyrnfr


reply via email to

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