all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* `scroll-conservatively'
@ 2007-05-27 18:17 Leo
  0 siblings, 0 replies; 3+ messages in thread
From: Leo @ 2007-05-27 18:17 UTC (permalink / raw)
  To: help-gnu-emacs

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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: `scroll-conservatively'
       [not found] <mailman.1334.1180289873.32220.help-gnu-emacs@gnu.org>
@ 2007-05-27 19:37 ` chming
  2007-05-27 20:22   ` `scroll-conservatively' chming
  0 siblings, 1 reply; 3+ messages in thread
From: chming @ 2007-05-27 19:37 UTC (permalink / raw)
  To: help-gnu-emacs

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 <sdl....@gmail.com> 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)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: `scroll-conservatively'
  2007-05-27 19:37 ` `scroll-conservatively' chming
@ 2007-05-27 20:22   ` chming
  0 siblings, 0 replies; 3+ messages in thread
From: chming @ 2007-05-27 20:22 UTC (permalink / raw)
  To: help-gnu-emacs

This might be better.

(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
           (previous-line (or arg 1))
           (point))))
    (if (not (pos-visible-in-window-p pos))
        (progn
	  (scroll-down (or arg 1))
	  (previous-line (or arg 1)))
	(previous-line (or 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
           (next-line (or arg 1))
           (point))))
    (if (not (pos-visible-in-window-p pos))
        (progn
	  (scroll-up (or arg 1))
	  (next-line (or arg 1)))
      (next-line (or arg 1)))))

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-27 20:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1334.1180289873.32220.help-gnu-emacs@gnu.org>
2007-05-27 19:37 ` `scroll-conservatively' chming
2007-05-27 20:22   ` `scroll-conservatively' chming
2007-05-27 18:17 `scroll-conservatively' Leo

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.