2019-06-03 Undoing without redoing

Emacs has a somewhat atypical undo feature – if you undo some changes (possibly more than one), and then break the sequence of undo commands (for example, by moving the point), any subsequent undo will, well, undo the previous undo – in other words, Emacs’ undo doubles as redo.

If you find this behavior confusing, you are not alone. The linked thread has two important tips, though. First of all, you can use the built-in undo-only command, which works exactly as the plain undo except that it does not exhibit the “redo” behavior.

A more sophisticated solution, also mentioned in the thread, is the undo-tree package. Personally, I learned to use the default Emacs undo system, and especially its behavior when the region is active. (Search the manual for “selective undo” to learn more.)

Probably the most interesting takeaway from that thread was that a new user of Emacs found the undo behavior confusing, but later – after some time and getting accustomed to it – did not really want to change it after all. Maybe that means that the Emacs way is better, maybe not – in either case you can make Emacs do what you want.

CategoryEnglish, CategoryBlog, CategoryEmacs