From 9625e3026b516cba3117d0096fe33ad7e523482b Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Tue, 8 Jun 2021 19:54:17 +0300 Subject: [PATCH] * lisp/simple.el (yank-from-kill-ring): Add edited string to the kill-ring. (Bug#48478) --- lisp/simple.el | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/simple.el b/lisp/simple.el index a0adaff431e..90dd8f1c342 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -5781,8 +5781,9 @@ When called from Lisp, insert STRING like `insert-for-yank' does." (insert-for-yank string) (when yank-from-kill-ring-rotate (let ((pos (seq-position kill-ring string))) - (when pos - (setq kill-ring-yank-pointer (nthcdr pos kill-ring))))) + (if pos + (setq kill-ring-yank-pointer (nthcdr pos kill-ring)) + (kill-new string)))) (if (consp arg) ;; Swap point and mark like in `yank' and `yank-pop'. (goto-char (prog1 (mark t) -- 2.39.5