branch: externals/ement
commit 76e90dc41877c6aaa1ab938dcde8eb440417ac8e
Author: Steven Allen <ste...@stebalien.com>
Commit: Adam Porter <a...@alphapapa.net>

    Enable image-mode when displaying images in a new buffer
    
    This makes it easy to, e.g., zoom the image (and prevents any attempts
    to edit it, add text to the buffer, etc.).
---
 README.org    | 1 +
 ement-room.el | 3 ++-
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/README.org b/README.org
index 0e628decae..b48936c226 100644
--- a/README.org
+++ b/README.org
@@ -304,6 +304,7 @@ Note that, while ~matrix-client~ remains usable, and 
probably will for some time
 + Command ~ement-room-image-show-mouse~ is used to show an image with the 
mouse.
 
 *Changes*
++ Enable ~image-mode~ when showing images in a new buffer.  (Thanks to 
[[https://github.com/Stebalien][Steven Allen]].)
 + Command ~ement-room-image-show~ is not used for mouse events.
 + Show useful message in SSO login page.
 
diff --git a/ement-room.el b/ement-room.el
index f8a0647a1d..eb8f2c5f4f 100644
--- a/ement-room.el
+++ b/ement-room.el
@@ -4050,7 +4050,8 @@ height."
           (image-property image :max-height) nil)
     (with-current-buffer new-buffer
       (erase-buffer)
-      (insert-image image))
+      (insert-image image)
+      (image-mode))
     (pop-to-buffer new-buffer '((display-buffer-pop-up-frame)))
     (set-frame-parameter nil 'fullscreen 'maximized)))
 

Reply via email to