Fix auto-reverting image-mode buffer (bug#21598)

When auto-reverting an image buffer, `image-mode' is not called since
`revert-buffer' is called with `preserve-modes' set to non-nil.

* lisp/image-mode.el (image-after-revert-hook): Check if there is an
image display property for the current buffer before updating it.
This commit is contained in:
Nicolas Petton 2016-07-25 23:40:35 +02:00
parent 50cc08bf6e
commit b176d16934
No known key found for this signature in database
GPG key ID: 233587A47C207910

View file

@ -784,6 +784,9 @@ Otherwise, display the image by calling `image-mode'"
(kill-buffer (current-buffer)))
(defun image-after-revert-hook ()
;; Fixes bug#21598
(when (not (image-get-display-property))
(image-toggle-display-image))
(when (image-get-display-property)
(image-toggle-display-text)
;; Update image display.