From: Juri Linkov Date: Tue, 8 Jun 2021 16:54:17 +0000 (+0300) Subject: * lisp/simple.el (yank-from-kill-ring): Add edited string to the kill-ring. X-Git-Tag: emacs-28.0.90~2159 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9625e3026b516cba3117d0096fe33ad7e523482b;p=emacs.git * lisp/simple.el (yank-from-kill-ring): Add edited string to the kill-ring. (Bug#48478) --- 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)