From 8780d8751e0f587624e8811aea7a40983d786d7c Mon Sep 17 00:00:00 2001 From: Lars Magne Ingebrigtsen Date: Sun, 26 Jun 2011 23:23:21 +0200 Subject: [PATCH] Stop any animations going on at article exit time. --- lisp/ChangeLog | 3 +++ lisp/gnus-art.el | 6 ++++++ lisp/gnus-sum.el | 2 ++ 3 files changed, 11 insertions(+) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index fcb70a122..ad363269c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,8 @@ 2011-06-26 Lars Magne Ingebrigtsen + * 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. diff --git a/lisp/gnus-art.el b/lisp/gnus-art.el index 3ebb5cc71..eca4debde 100644 --- a/lisp/gnus-art.el +++ b/lisp/gnus-art.el @@ -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) diff --git a/lisp/gnus-sum.el b/lisp/gnus-sum.el index f974d386a..4c059e933 100644 --- a/lisp/gnus-sum.el +++ b/lisp/gnus-sum.el @@ -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) -- 2.34.1