]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (yank-from-kill-ring): Fix kill-ring-yank-pointer (bug#48478)
authorJuri Linkov <juri@linkov.net>
Fri, 21 May 2021 18:18:09 +0000 (21:18 +0300)
committerJuri Linkov <juri@linkov.net>
Fri, 21 May 2021 18:18:09 +0000 (21:18 +0300)
lisp/simple.el

index f139555dd3406c555a9d87230516c1d766a87cb7..2a90a0763158d7d4769592049a032cd2736ab48c 100644 (file)
@@ -5772,9 +5772,8 @@ 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)))
-      (setq kill-ring-yank-pointer
-            (or (and pos (nthcdr pos kill-ring))
-                kill-ring))))
+      (when pos
+        (setq kill-ring-yank-pointer (nthcdr pos kill-ring)))))
   (if (consp arg)
       ;; Swap point and mark like in `yank' and `yank-pop'.
       (goto-char (prog1 (mark t)