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

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

Re: continuous fractional scrolling


From: B . T . Raven
Subject: Re: continuous fractional scrolling
Date: 12 Jun 2015 09:11:45 -0700
User-agent: Direct Read News 5.60

<877fr9ygun.fsf@debian.uxu>Emanuel BergFri, 12 Jun 2015 01:18:08 +0200
>
>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
>

Thanks for all this, Emanuel. Maybe line-at-a-time will work out okay but I
think in will necessarily more jerky (cause saccades and maybe more tiring to
read). Anyway, I'll study your code and give it a try.

Ed



reply via email to

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