emacs-devel
[Top][All Lists]
Advanced

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

Re: set-window-vscroll causes infinite loop in redisplay


From: Kim F. Storm
Subject: Re: set-window-vscroll causes infinite loop in redisplay
Date: 26 Feb 2003 01:20:51 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3.50

"D. Goel" <address@hidden> writes:


> hello
> 
> I can get set-window-vscroll to work from M-: or from inside functions
> containing that one single command.
> 
> Example:
> 
> (defun vel-scroll-up-fractional (acc)
>     (set-window-vscroll nil acc))
> 
> works just fine when acc is 0.5
> 
> However, 
> try
> 
> (defun vel-scroll-up (amount acc)     
>   (scroll-up amount)  
>   (set-window-vscroll nil acc))
> 
> where amount is 0 and acc is 0.5.  (the first one is a dummy line
> supposed to do nothing here..)
> 
> And the second line seems to have no effect at all.
> 

I can confirm this (not) happening here too.

The problem seems to that after a scroll (even a zero scroll), the
function window_scroll_pixel_based sets w->force_start = Qt, which
later causes the redisplay engine to set w->vscroll to 0.

Since this happens during redisplay, the set-window-vscroll
function has already been called, and the explicit setting of
w->vscroll is lost.

The following version is one way to work-around this problem:
(defun vel-scroll-up (amount acc)       
  (scroll-up amount)    
  (sit-for 0)
  (set-window-vscroll nil acc))

I think the proper fix is to define a separate w->vscroll_extra member
(controlled via set-window-vscroll) which specifies the smooth scroll
offset the user wants ... and let the automatic vscroll adjustment
take this into account (except at the top and bottom of the buffer).

-- 
Kim F. Storm <address@hidden> http://www.cua.dk





reply via email to

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