In one of my windows I've opened "output.png" and I would like emacs to automatically reload it if it has changed.
I would like to do this for all PNG files which are currently open, but only PNG files. How to I do this?
In one of my windows I've opened "output.png" and I would like emacs to automatically reload it if it has changed.
I would like to do this for all PNG files which are currently open, but only PNG files. How to I do this?
You need to enable the auto-revert-mode
. It will reload the file every 5 seconds. see gnu.org/emacs/manual/Reverting
To enable it in the image buffer for the current session only type M-x auto-revert-mode
Note: in my experience with Emacs 25.3 the buffer will display the image as ascii text after reverting it. To fix that type: M-x auto-image-file-mode
To use these settings for all buffers displaying an image I've added to my ~/.emacs/
file:
(add-hook 'image-mode-hook
(lambda ()
(auto-revert-mode)
(auto-image-file-mode)))