Stop any animations going on at article exit time.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Jun 2011 21:23:21 +0000 (23:23 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sun, 26 Jun 2011 21:23:21 +0000 (23:23 +0200)
lisp/ChangeLog
lisp/gnus-art.el
lisp/gnus-sum.el

index fcb70a1..ad36326 100644 (file)
@@ -1,5 +1,8 @@
 2011-06-26  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * gnus-art.el (gnus-article-stop-animations): New function to stop any
+       animations going on at article exit time.
+
        * gnus-registry.el (gnus-registry-user-format-function-M): Reinstate,
        since removing it breaks people upgrading.
 
index 3ebb5cc..eca4deb 100644 (file)
@@ -4509,6 +4509,7 @@ commands:
                 t)))
        (with-current-buffer name
          (set (make-local-variable 'gnus-article-edit-mode) nil)
+         (gnus-article-stop-animations)
          (when gnus-article-mime-handles
            (mm-destroy-parts gnus-article-mime-handles)
            (setq gnus-article-mime-handles nil))
@@ -4533,6 +4534,11 @@ commands:
          (gnus-start-date-timer gnus-article-update-date-headers))
        (current-buffer)))))
 
+(defun gnus-article-stop-animations ()
+  (dolist (timer timer-list)
+    (when (eq (aref timer 5) 'image-animate-timeout)
+      (cancel-timer timer))))
+
 ;; Set article window start at LINE, where LINE is the number of lines
 ;; from the head of the article.
 (defun gnus-article-set-window-start (&optional line)
index f974d38..4c059e9 100644 (file)
@@ -7298,6 +7298,7 @@ If FORCE (the prefix), also save the .newsrc file(s)."
       (run-hooks 'gnus-summary-prepare-exit-hook)
       (when (gnus-buffer-live-p gnus-article-buffer)
        (with-current-buffer gnus-article-buffer
+         (gnus-article-stop-animations)
          (mm-destroy-parts gnus-article-mime-handles)
          ;; Set it to nil for safety reason.
          (setq gnus-article-mime-handle-alist nil)
@@ -9579,6 +9580,7 @@ C-u g', show the raw article."
       ;; Destroy any MIME parts.
       (when (gnus-buffer-live-p gnus-article-buffer)
        (with-current-buffer gnus-article-buffer
+         (gnus-article-stop-animations)
          (mm-destroy-parts gnus-article-mime-handles)
          ;; Set it to nil for safety reason.
          (setq gnus-article-mime-handle-alist nil)