3

Are there any tools to directly edit the kill-ring?

If I open xah-show-kill-ring, I'm tempted to edit the contents directly.

4
  • 2
    So why not try it? What's the worst that can happen? In any case, did you C-h v kill-ring?
    – NickD
    Dec 13, 2023 at 12:39
  • Why? What are you really trying to do? Sounds like an X-Y question.
    – Drew
    Dec 13, 2023 at 17:23
  • Well, right now I first copied the type of a variable, then I copied the name of the variable, which also included a comma at the end. Then I opened the kill buffer and wanted to move the type to the same entry as the name and remove the comma. It seemed like a natural thing to do. What I usually do is yank first what I have in the kill-ring, then open the kill-ring and yank the second part, then combine them and kill them again, so that I can yank it in to where I need it to be. I'm not really sure what is the best way, but I'd like to explore working directly on the kill-ring;) Dec 13, 2023 at 21:11
  • 1
    Maybe a dumb idea, not sure, yet;) Dec 13, 2023 at 21:11

1 Answer 1

4

The contents of the kill ring is, by definition, the value of the variable kill-ring, which is a list of strings. You can change the contents of the kill ring by modifying this variable and (depending on what you're doing) updating kill-ring-yank-pointer accordingly.

I don't think Emacs comes with any convenient interface to edit the kill ring. You have to write Lisp code or use a third-party package.

At least browse-kill-ring (available from MELPA) and browse-kill-ring+ have an interface to edit and remove kill ring entries. (But not to add: just copy something. And not to reorder.)

There are many other kill ring browsing interfaces, but I don't know if they have editing capabilities.

1
  • No. browse-kill-ring+ is neither unmaintained nor a fork of anything. It enhances what browse-kill-ring.el offers. I've edited the answer to remove that characterization.
    – Drew
    Dec 13, 2023 at 20:57

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.