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?

Drew
  • 77,472
  • 10
  • 114
  • 243
Pedro Delfino
  • 1,489
  • 3
  • 16

1 Answers1

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.

Fran Burstall
  • 3,855
  • 11
  • 18
  • 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? – Pedro Delfino May 06 '22 at 22:21
  • 2
    Drop the "r" in the interactive form: you aren't trying to do anything to a region. – Fran Burstall May 06 '22 at 22:26