From b176d169347925d57ca63ab63b85d92e49a53c81 Mon Sep 17 00:00:00 2001 From: Nicolas Petton Date: Mon, 25 Jul 2016 23:40:35 +0200 Subject: [PATCH] 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. --- lisp/image-mode.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index a18b07ebe6a..f52668536ca 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -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. -- 2.39.2