Programming in Emacs Lisp
rotate-yank-pointer function changes the element in the kill
ring to which
kill-ring-yank-pointer points. For example, it can
kill-ring-yank-pointer from pointing to the second
element to point to the third element.
Here is the code for
(defun rotate-yank-pointer (arg)
"Rotate the yanking point in the kill ring."
(let ((length (length kill-ring)))
(if (zerop length)
(error "Kill ring is empty")
(nthcdr (% (+ arg