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

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

Re: Smooth scrolling


From: David Engster
Subject: Re: Smooth scrolling
Date: Thu, 08 Jul 2010 10:51:04 +0200
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (gnu/linux)

Jesse W. Wilson writes:
> Perhaps the following could be of use?
> http://www.gnu.org/s/emacs/manual/html_node/elisp/Vertical-Scrolling.html
>
> If I type this in a buffer and eval with c-x c-e,
> (set-window-vscroll (selected-window) 0.3)
>
> It seems to scroll a fraction of a line downward.
>
> Of course I haven't a clue how it could be incorporated into bindings
> for the scroll wheel.

Yes, Emacs can do "fractional" (read: pixel-wise) scrolling with the
set-window-vscroll command you mentioned above. For example,
picture-mode can smooth-scroll an image just fine. However, there are
two caveats: it is slow, and the point must remain visible during
scrolling.

I've fiddled with this stuff a while ago to implement a smoother
scrolling for buffers with images in them. See

http://www.randomsample.de/dru5/node/25
http://www.randomsample.de/dru5/node/26

for how far I've come. Those functions use set-window-vscroll to scroll
the buffer and move point in a way so that it always remains
visible. However, you'll notice that the higher the vscroll value of the
current window, the slower scrolling becomes, so it's of limited
value. Also, it doesn't work well with the other point-moving commands,
so it's currently only useful for read-only buffers.

Regards,
David




reply via email to

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