[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master f13300e84a 1/2: Delete the correct region after cropping an image
From: |
Lars Ingebrigtsen |
Subject: |
master f13300e84a 1/2: Delete the correct region after cropping an image |
Date: |
Fri, 23 Sep 2022 11:38:25 -0400 (EDT) |
branch: master
commit f13300e84aecb89626eec6d62ce651270619a3e3
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Delete the correct region after cropping an image
* lisp/image/image-crop.el (image-crop): Delete the correct region
after editing (bug#58027).
---
lisp/image/image-crop.el | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lisp/image/image-crop.el b/lisp/image/image-crop.el
index d17c2ae389..8ec4679b9b 100644
--- a/lisp/image/image-crop.el
+++ b/lisp/image/image-crop.el
@@ -176,7 +176,7 @@ After cropping an image, you can save it by `M-x
image-save' or
(point-max)))))
(text (buffer-substring image-start image-end))
(inhibit-read-only t)
- orig-data)
+ orig-data svg-end)
(with-temp-buffer
(set-buffer-multibyte nil)
(if (null data)
@@ -196,6 +196,7 @@ After cropping an image, you can save it by `M-x
image-save' or
(with-buffer-unmodified-if-unchanged
(delete-region image-start image-end)
(svg-insert-image svg)
+ (setq svg-end (point))
(let ((area (condition-case _
(save-excursion
(forward-line 1)
@@ -205,7 +206,7 @@ After cropping an image, you can save it by `M-x
image-save' or
(message (substitute-command-keys
"Type \\[image-save] to save %s image to file")
(if cut "cut" "cropped"))
- (delete-region (pos-bol) (pos-eol))
+ (delete-region image-start svg-end)
(if area
(image-crop--crop-image-update
area orig-data size type cut text)