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

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

Re: Scrolling in buffers with inline images / point outside viewport


From: Eli Zaretskii
Subject: Re: Scrolling in buffers with inline images / point outside viewport
Date: Mon, 10 Jun 2013 20:01:00 +0300

> From: David Engster <deng@randomsample.de>
> Date: Mon, 10 Jun 2013 17:53:52 +0200
> 
> (with-selected-window (get-buffer-window ".emacs")
>   (setq times-to-vscroll nil)
>   (let (newval oldval)
>     (setq oldval (float-time (current-time)))
>     (dotimes (i 500)
>       (setq newval (float-time (current-time)))
>       (push (- newval oldval) times-to-vscroll)
>       (setq oldval newval)
>       (set-window-vscroll nil (+ (window-vscroll) 1))
>       (redisplay t))))
> 
> I remember that this started quite fast with times well under a second
> per scroll, but then grew up to 2 seconds or more at the end.
> 
> However, when I try this now, this code simply does not work; as soon as
> the cursor leaves the viewport, it somehow resets back to the original
> position. I have no idea what's going on.

Emacs won't let you use vscroll if the line with the cursor isn't at
least partially visible -- it will reset the vscroll to bring point
into view.

Try making the window with .emacs as tall as you can, and put the
cursor on its last line, before invoking the code above.  It works.



reply via email to

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