* lisp/image.el (image-animate, image-animate-timeout): Stop animating images
in dead buffers. Fixes: debbugs:16878
This commit is contained in:
parent
c107155e62
commit
f086804c36
2 changed files with 29 additions and 24 deletions
|
|
@ -1,5 +1,8 @@
|
|||
2014-02-25 Glenn Morris <rgm@gnu.org>
|
||||
|
||||
* image.el (image-animate, image-animate-timeout):
|
||||
Stop animating images in dead buffers. (Bug#16878)
|
||||
|
||||
* emacs-lisp/edebug.el (defmacro): Fix debug spec. (Bug#16868)
|
||||
|
||||
* faces.el (tty-setup-hook, tty-run-terminal-initialization): Doc fixes.
|
||||
|
|
|
|||
|
|
@ -662,6 +662,7 @@ number, play until that number of seconds has elapsed."
|
|||
(when animation
|
||||
(if (setq timer (image-animate-timer image))
|
||||
(cancel-timer timer))
|
||||
(plist-put (cdr image) :animate-buffer (current-buffer))
|
||||
(run-with-timer 0.2 nil 'image-animate-timeout
|
||||
image (or index 0) (car animation)
|
||||
0 limit))))
|
||||
|
|
@ -726,30 +727,31 @@ The minimum delay between successive frames is `image-minimum-frame-delay'.
|
|||
|
||||
If the image has a non-nil :speed property, it acts as a multiplier
|
||||
for the animation speed. A negative value means to animate in reverse."
|
||||
(image-show-frame image n t)
|
||||
(let* ((speed (image-animate-get-speed image))
|
||||
(time (float-time))
|
||||
(animation (image-multi-frame-p image))
|
||||
;; Subtract off the time we took to load the image from the
|
||||
;; stated delay time.
|
||||
(delay (max (+ (* (or (cdr animation) image-default-frame-delay)
|
||||
(/ 1 (abs speed)))
|
||||
time (- (float-time)))
|
||||
image-minimum-frame-delay))
|
||||
done)
|
||||
(setq n (if (< speed 0)
|
||||
(1- n)
|
||||
(1+ n)))
|
||||
(if limit
|
||||
(cond ((>= n count) (setq n 0))
|
||||
((< n 0) (setq n (1- count))))
|
||||
(and (or (>= n count) (< n 0)) (setq done t)))
|
||||
(setq time-elapsed (+ delay time-elapsed))
|
||||
(if (numberp limit)
|
||||
(setq done (>= time-elapsed limit)))
|
||||
(unless done
|
||||
(run-with-timer delay nil 'image-animate-timeout
|
||||
image n count time-elapsed limit))))
|
||||
(when (buffer-live-p (plist-get (cdr image) :animate-buffer))
|
||||
(image-show-frame image n t)
|
||||
(let* ((speed (image-animate-get-speed image))
|
||||
(time (float-time))
|
||||
(animation (image-multi-frame-p image))
|
||||
;; Subtract off the time we took to load the image from the
|
||||
;; stated delay time.
|
||||
(delay (max (+ (* (or (cdr animation) image-default-frame-delay)
|
||||
(/ 1 (abs speed)))
|
||||
time (- (float-time)))
|
||||
image-minimum-frame-delay))
|
||||
done)
|
||||
(setq n (if (< speed 0)
|
||||
(1- n)
|
||||
(1+ n)))
|
||||
(if limit
|
||||
(cond ((>= n count) (setq n 0))
|
||||
((< n 0) (setq n (1- count))))
|
||||
(and (or (>= n count) (< n 0)) (setq done t)))
|
||||
(setq time-elapsed (+ delay time-elapsed))
|
||||
(if (numberp limit)
|
||||
(setq done (>= time-elapsed limit)))
|
||||
(unless done
|
||||
(run-with-timer delay nil 'image-animate-timeout
|
||||
image n count time-elapsed limit)))))
|
||||
|
||||
|
||||
(defvar imagemagick-types-inhibit)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue