]> git.eshelyaron.com Git - emacs.git/commitdiff
Make image cropping work in image-mode buffers
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 14 Sep 2022 14:04:23 +0000 (16:04 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 14 Sep 2022 14:04:52 +0000 (16:04 +0200)
* lisp/image-mode.el (image-mode): Update the buffer text after
cropping (bug#57793).

lisp/image-mode.el

index dded6d4f389ac190c8ff252575257bec15aaeb34..bc0f7ccb0483823d2d3ac727fb835e96ae863150 100644 (file)
@@ -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