From: Nicolas Petton Date: Mon, 25 Jul 2016 21:40:35 +0000 (+0200) Subject: Fix auto-reverting image-mode buffer (bug#21598) X-Git-Tag: emacs-26.0.90~1840^2~12 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b176d169347925d57ca63ab63b85d92e49a53c81;p=emacs.git 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. --- 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.