From 576eba77d3798dde08ae575ab5a47ea48fc1f185 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 14 Sep 2022 16:04:23 +0200 Subject: [PATCH] Make image cropping work in image-mode buffers * lisp/image-mode.el (image-mode): Update the buffer text after cropping (bug#57793). --- lisp/image-mode.el | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lisp/image-mode.el b/lisp/image-mode.el index dded6d4f389..bc0f7ccb048 100644 --- a/lisp/image-mode.el +++ b/lisp/image-mode.el @@ -667,6 +667,9 @@ Key bindings: "(New file)") "Empty buffer")) (image-mode--display) + (setq-local image-crop-buffer-text-function + ;; Use the binary image data directly for the buffer text. + (lambda (_text image) image)) ;; Ensure that we recognize externally parsed image formats in ;; commands like `n'. (when image-use-external-converter -- 2.39.2