From: Lars Ingebrigtsen Date: Mon, 3 May 2021 10:21:11 +0000 (+0200) Subject: ediff shouldn't alter the kill ring when copying a diff X-Git-Tag: emacs-28.0.90~2632 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=1dafab893652c42be807e9a44005413cb7915f81;p=emacs.git 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). --- 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) ))