Skip to content

Commit

Permalink
* lisp/simple.el (yank-from-kill-ring): Fix kill-ring-yank-pointer (b…
Browse files Browse the repository at this point in the history
…ug#48478)
  • Loading branch information
link0ff committed May 21, 2021
1 parent bab7e85 commit dfe79a8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions lisp/simple.el
Expand Up @@ -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)
Expand Down

0 comments on commit dfe79a8

Please sign in to comment.