From 1dafab893652c42be807e9a44005413cb7915f81 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Mon, 3 May 2021 12:21:11 +0200 Subject: [PATCH] ediff shouldn't alter the kill ring when copying a diff * lisp/vc/ediff-util.el (ediff-copy-diff, ediff-pop-diff): Don't alter the kill ring (bug#47881). --- lisp/vc/ediff-util.el | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lisp/vc/ediff-util.el b/lisp/vc/ediff-util.el index 1c784908702..b2b92b17e28 100644 --- a/lisp/vc/ediff-util.el +++ b/lisp/vc/ediff-util.el @@ -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) )) -- 2.39.5