]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (yank-from-kill-ring): Add edited string to the kill-ring.
authorJuri Linkov <juri@linkov.net>
Tue, 8 Jun 2021 16:54:17 +0000 (19:54 +0300)
committerJuri Linkov <juri@linkov.net>
Tue, 8 Jun 2021 16:54:17 +0000 (19:54 +0300)
(Bug#48478)

lisp/simple.el

index a0adaff431e5ca9ba0de70cd3f5d66c8786e0f61..90dd8f1c342a5fcd0cfc896c2da89a64e8c58ada 100644 (file)
@@ -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)