If we're reimplementing readline, we might as well go all the way: readline undo. Ctrl-_ as a default? I imagine we'll need to store a stack of previous line states, be able to restore them, and hopefully combine similar editing operations.