Subject: bug#23431: 25.0.93; EWW hangs

From: Lars Ingebrigtsen <[email-masked]>
Date: Tue, 03 May 2016 18:26:52 +0200

Eli Zaretskii <[email-masked]> writes:

>> From: Lars Ingebrigtsen <[email-masked]>
>> Date: Tue, 03 May 2016 17:57:59 +0200
>> Cc: [email-masked]
>> 
>> First of all: Can the animation function determine that it's making
>> Emacs unresponsive?  I guess it could keep track of how much time is
>> passing between each time it's called, and if that's longer than the
>> timeout, it should ... postpone itself a bit further to allow some
>> keystrokes to get in between each frame?
>
> Can you show how that function is called on the Lisp level?

It's the `image-animate-timeout' function in image.el.

(defun image-animate-timeout (image n count time-elapsed limit)

[...]

	   (delay (max (+ (* (or (cdr animation) image-default-frame-delay)
			     (/ 1.0 (abs speed)))
			  time (- (float-time)))
		       image-minimum-frame-delay))

[...]

      (unless done
	(run-with-timer delay nil 'image-animate-timeout
			image n count time-elapsed limit)))))

So I think it shouldn't be too difficult to ... do something useful
here...

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no