1

I really like counsel-yank-pop. I like it so much that I have changed my keybindings so that C-y is bounded to counsel-yank-pop. However, after a while the kill-ring tends to become a big mess.

I would like to "clear" it. It is already possible to do so by re-starting Emacs. But, I would like to do it without re-starting Emacs. Is there some way?

Would it be necessary to write a tailor-made function in Elisp and put it my init file to achieve this result?

1 Answer 1

4

Um,

(setq kill-ring nil)

The clue that this should work is that this is the value of kill-ring when you start emacs.

2
  • Thanks, I am trying to transform it into a function to be a command. But it does not work out. I tried inserting this on my init file: (defun clear-kill-ring () "Clear the results on the kill ring." (interactive "r") (setq kill-ring nil)) . Do you know how to fix it? May 6, 2022 at 22:21
  • 2
    Drop the "r" in the interactive form: you aren't trying to do anything to a region. May 6, 2022 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.