]> git.eshelyaron.com Git - emacs.git/commitdiff
ediff shouldn't alter the kill ring when copying a diff
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 3 May 2021 10:21:11 +0000 (12:21 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 3 May 2021 10:21:11 +0000 (12:21 +0200)
* lisp/vc/ediff-util.el (ediff-copy-diff, ediff-pop-diff): Don't
alter the kill ring (bug#47881).

lisp/vc/ediff-util.el

index 1c78490870200e116ebc22740a366b39bb0ef754..b2b92b17e28fe6b4f35d9fa2b9cd035a04f01c97 100644 (file)
@@ -2002,9 +2002,8 @@ ARG is a prefix argument.  If nil, copy the current difference region."
                    (goto-char reg-to-delete-end)
                    (insert reg-to-copy)
 
-                   (if (> reg-to-delete-end reg-to-delete-beg)
-                       (kill-region reg-to-delete-beg reg-to-delete-end))
-                   ))
+                   (when (> reg-to-delete-end reg-to-delete-beg)
+                     (delete-region reg-to-delete-beg reg-to-delete-end))))
                (or batch-invocation
                    (setq
                     messg
@@ -2105,8 +2104,8 @@ ARG is a prefix argument.  If nil, copy the current difference region."
            (goto-char reg-end)
            (insert saved-diff)
 
-           (if (> reg-end reg-beg)
-               (kill-region reg-beg reg-end))
+           (when (> reg-end reg-beg)
+             (delete-region reg-beg reg-end))
 
            (setq recovered t)
            ))