changeset 108779:f2b6722a5113

* image-mode.el (image-mode): Add image-after-revert-hook to after-revert-hook. (image-after-revert-hook): New function. (Bug#5669)
author Juri Linkov <juri@jurta.org>
date Tue, 25 May 2010 19:03:53 +0300
parents 6c819187f088
children eccb3cdf5081
files lisp/ChangeLog lisp/image-mode.el
diffstat 2 files changed, 15 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue May 25 18:54:53 2010 +0300
+++ b/lisp/ChangeLog	Tue May 25 19:03:53 2010 +0300
@@ -1,3 +1,9 @@
+2010-05-25  Juri Linkov  <juri@jurta.org>
+
+	* image-mode.el (image-mode): Add image-after-revert-hook to
+	after-revert-hook.
+	(image-after-revert-hook): New function.  (Bug#5669)
+
 2010-05-25  Juri Linkov  <juri@jurta.org>
 
 	* image.el (image-animated-p): When delay between animated images
--- a/lisp/image-mode.el	Tue May 25 18:54:53 2010 +0300
+++ b/lisp/image-mode.el	Tue May 25 19:03:53 2010 +0300
@@ -357,6 +357,7 @@
 	(image-mode-setup-winprops)
 
 	(add-hook 'change-major-mode-hook 'image-toggle-display-text nil t)
+	(add-hook 'after-revert-hook 'image-after-revert-hook nil t)
 	(run-mode-hooks 'image-mode-hook)
 	(message "%s" (concat
 		       (substitute-command-keys
@@ -503,6 +504,14 @@
   (if (image-get-display-property)
       (image-mode-as-text)
     (image-mode)))
+
+(defun image-after-revert-hook ()
+  (when (image-get-display-property)
+    (image-toggle-display-text)
+    ;; Update image display.
+    (redraw-frame (selected-frame))
+    (image-toggle-display-image)))
+
 
 ;;; Support for bookmark.el
 (declare-function bookmark-make-record-default "bookmark"