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

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

Re: continuous fractional scrolling


From: Emanuel Berg
Subject: Re: continuous fractional scrolling
Date: Fri, 12 Jun 2015 01:18:08 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

B. T. Raven <btraven@nihil.net> writes:

> Is there a way in Emacs to make a text buffer
> continually scroll without user interaction?

I think the best scrolling is one line at a time and
that at a short, close and natural shortcut, e.g. M-i
to scroll up, and M-k to scroll down.

I have C-M-j and C-M-l to scroll sideways (left and
right, respectively) - the reason I don't have that
M-j and M-l is I have those to iterate the Linux VTs,
which I do much more often than scroll horizontally in
Emacs...

That said, what you ask for should be possible indeed.
Try this:

(require 'cl-macs)

;; civilized scrolling - one line at a time
(setq scroll-conservatively 10000)
(setq auto-window-vscroll nil)

;; scroll the current window
(defun scroll-up-1 ()
  (interactive)
  (scroll-down 1) )
(defun scroll-down-1 ()
  (interactive)
  (scroll-up 1) )

;; automatic scrolling
(defun start-automatic-scroll-down ()
  (interactive)
  (let ((win))
    (cl-loop do
             (progn (setq win (window-end))
                    (scroll-down-1)
                    (sleep-for 1) ; put speed here in seconds
                    (redisplay) )
     until (= win (window-end)) )))
;; (start-automatic-scroll-down)
;;                             ^ test here

If you prefer the original file, which also contains
my other scroll stuff (the stuff mentioned first
paragraph), check out this URL:

    http://user.it.uu.se/~embe8573/conf/emacs-init/scroll.el

-- 
underground experts united
http://user.it.uu.se/~embe8573


reply via email to

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