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

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

Re: `scroll-conservatively'


From: chming
Subject: Re: `scroll-conservatively'
Date: 27 May 2007 12:37:10 -0700
User-agent: G2/1.0

flet it go. try this way:

(defun scroll-one-line-up (&optional arg)
  "Scroll the selected window up (forward in the text) one line (or N
lines)."
  (interactive "p")
  (let ((pos
         (save-excursion
           (forward-line (* arg -1))
           (point))))
    (if (not (pos-visible-in-window-p pos))
        (progn
          (scroll-down (or arg 1))
          (forward-line -1))
      (forward-line (* arg -1)))))

(defun scroll-one-line-down (&optional arg)
  "Scroll the selected window down (backward in the text) one line (or
N)."
  (interactive "p")
  (let ((pos
         (save-excursion
           (forward-line (or arg 1))
           (point))))
    (if (not (pos-visible-in-window-p pos))
        (progn
          (scroll-up (or arg 1))
          (forward-line (or arg 1)))
      (forward-line (or arg 1)))))

(global-set-key   (kbd "C-p")     'scroll-one-line-up)
(global-set-key   (kbd "C-n")     'scroll-one-line-down)

On May 27, 11:17 am, Leo <address@hidden> wrote:
> Hi all,
>
> I try to set scroll-conservatively to an integer, however I fail to see
> the difference for different integers. Ideas?
>
> Thanks,
> --
> Leo <sdl.web AT gmail.com>                         (GPG Key: 9283AA3F)




reply via email to

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