Rather than write a real blog post, here’s a quick PSA.

In Emacs, any text you cut is stored on what’s called the “kill ring”. After you paste (aka “yank” in Emacs terminology) something, you can press M-y (yank-pop) to cycle through things that are stored on the kill ring. It’s a pretty basic thing, but I’ve only just started using it, and up until now the kill ring has been an endless source of frustration for me. So, I figured it’s worth posting.

Much to my surprise, M-y still works with CUA mode - it just calls cua-paste-pop instead. I had avoided using the kill ring mainly because I didn’t think it would work with CUA mode.

My frustration with the kill ring is that years of living with Windows has taught me that the backspace key is just delete in reverse. Normally (or at least, in CUA mode) Emacs respects this on Windows. Yet fgallina’s Python mode, and Markdown mode remap backspace so that it “kills” instead of just deleting.

Imagine my frustration every time I go to paste a bit of code, and instead an empty line is inserted, or a single character that I happened to press backspace on, instead of what I actually wanted. This was happening on at least once per day before I went looking to see if I could cycle the kill ring in CUA mode.

Side note: Both of those modes remap backspace for the same reason - to provide “smart” indentation handling. Really wish they would respect CUA mode, but I have no idea how to beg for something like that now that fgallina’s python.el is officially part of Emacs. May request a change in Markdown mode, though.